Advertisement
BaSs_HaXoR

IntPtr - Defined and explained

Feb 23rd, 2015
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.28 KB | None | 0 0
  1. System.IntPtr Structure: What is IntPtr?
  2. ########################################################################################################################################################################################################################
  3. An IntPtr is a "native (platform-specific) size integer." It's internally represented as void* but exposed as an integer. You can use it whenever you need to store an unmanaged pointer and don't want to use unsafe code. IntPtr.Zero is effectively NULL (a null pointer).
  4. ########################################################################################################################################################################################################################
  5. System.IntPtr Structure #
  6. public struct IntPtr #
  7. ########################################################################################################################################################################################################################
  8. Base Types #
  9. Object #
  10. ValueType #
  11. IntPtr #
  12. ########################################################################################################################################################################################################################
  13. Assembly #
  14. mscorlib #
  15. ########################################################################################################################################################################################################################
  16. Library #
  17. RuntimeInfrastructure #
  18. ########################################################################################################################################################################################################################
  19. Summary #
  20. An implementation-specific type that is used to represent a pointer or a handle. #
  21. ########################################################################################################################################################################################################################
  22. Description
  23.  
  24. The IntPtr type is designed to be an implementation-sized pointer. An instance of this type is expected to be the size of a native int for the current implementation.
  25. For more information on the native int type, see Partition II of the CLI Specification.
  26.  
  27. [Note: The IntPtr type provides CLS-compliant pointer functionality.
  28.  
  29. IntPtr instances can also be used to hold handles.
  30.  
  31. The IntPtr type is CLS-compliant while the UIntPtr type is not. The UIntPtr type is provided mostly to maintain architectural symmetry with the IntPtr type.
  32. ########################################################################################################################################################################################################################
  33. //Source: https://www.gnu.org/projects/dotgnu/pnetlib-doc/System/IntPtr.html
  34. //Source: https://stackoverflow.com/questions/1148177/just-what-is-an-intptr-exactly
  35. //BaSs_HaXoR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement