Callum Rogers Callum Rogers - 1 year ago 75
C# Question

Just what is an IntPtr exactly?

Through using IntelliSense and looking at other people's code, I have come across this

type; every time it has needed to be used I have simply put
and found most functions to work. What exactly is it and when/why is it used?

Answer Source

It's 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).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download