I didn't understand what is IntPtr, could someone explain this? thanks
what is intptr?
17.5k views Asked by lital maatuk At
6
There are 6 answers
0
On
It's a .NET platform-specific type that is used to represent a pointer or a handle.
The IntPtr 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 IntPtr 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.
IntPtr objects can also be used to hold handles. For example, instances of IntPtr are used extensively in the System.IO.FileStream class to hold file handles.
(from MSDSN)
0
On
This is about the c and c++ type intptr_t but the principle is the same. What is uintptr_t data type
It is the managed counterpart of
void*
.You can cast to and from
void*
for usage in managed code without having to resort to unsafe code in managed layers, eg C#.