A platform-specific type that is used to represent a pointer or a handle.
Assembly: mscorlib (in mscorlib.dll)
<[%$TOPIC/5he14kz8_en-us_VS_110_1_0_0_0_0%]> _ <[%$TOPIC/5he14kz8_en-us_VS_110_1_0_0_0_1%](True)> _ Public Structure IntPtr _ Implements [%$TOPIC/5he14kz8_en-us_VS_110_1_0_0_0_2%]
[[%$TOPIC/5he14kz8_en-us_VS_110_1_0_1_0_0%]] [[%$TOPIC/5he14kz8_en-us_VS_110_1_0_1_0_1%](true)] public struct IntPtr : [%$TOPIC/5he14kz8_en-us_VS_110_1_0_1_0_2%]
[[%$TOPIC/5he14kz8_en-us_VS_110_1_0_2_0_0%]] [[%$TOPIC/5he14kz8_en-us_VS_110_1_0_2_0_1%](true)] public value class IntPtr : [%$TOPIC/5he14kz8_en-us_VS_110_1_0_2_0_2%]
[<[%$TOPIC/5he14kz8_en-us_VS_110_1_0_3_0_0%]>] [<[%$TOPIC/5he14kz8_en-us_VS_110_1_0_3_0_1%]>] [<[%$TOPIC/5he14kz8_en-us_VS_110_1_0_3_0_2%](true)>] type IntPtr = struct interface [%$TOPIC/5he14kz8_en-us_VS_110_1_0_3_0_3%] end
Thetype exposes the following members.
|Add||Adds an offset to the value of a pointer.|
|Equals||Returns a value indicating whether this instance is equal to a specified object. (Overrides ValueTypeEquals(Object).)|
|GetHashCode||Returns the hash code for this instance. (Overrides ValueTypeGetHashCode.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|Subtract||Subtracts an offset from the value of a pointer.|
|ToInt32||Converts the value of this instance to a 32-bit signed integer.|
|ToInt64||Converts the value of this instance to a 64-bit signed integer.|
|ToPointer||Converts the value of this instance to a pointer to an unspecified type.|
|ToString||Converts the numeric value of the current object to its equivalent string representation. (Overrides ValueTypeToString.)|
|ToString(String)||Converts the numeric value of the current object to its equivalent string representation.|
|Addition||Adds an offset to the value of a pointer.|
|Equality||Determines whether two specified instances of are equal.|
|(Int32 to IntPtr)||Converts the value of a 32-bit signed integer to an .|
|(Int64 to IntPtr)||Converts the value of a 64-bit signed integer to an .|
|(IntPtr to Void*)||Converts the value of the specified to a pointer to an unspecified type.|
|(IntPtr to Int32)||Converts the value of the specified to a 32-bit signed integer.|
|(IntPtr to Int64)||Converts the value of the specified to a 64-bit signed integer.|
|(Void* to IntPtr)||Converts the specified pointer to an unspecified type to an .|
|Inequality||Determines whether two specified instances of are not equal.|
|Subtraction||Subtracts an offset from the value of a pointer.|
|Zero||A read-only field that represents a pointer or handle that has been initialized to zero.|
The type is designed to be an integer whose size is platform-specific. That is, an instance of this type is expected to be 32-bits on 32-bit hardware and operating systems, and 64-bits on 64-bit hardware and operating systems.
The type can be used by languages that support pointers, and as a common means of referring to data between languages that do and do not support pointers.
objects can also be used to hold handles. For example, instances of are used extensively in the System.IOFileStream class to hold file handles.
This type implements the ISerializable interface.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.