In C ++, each integer type doubles its size when running on a 64-bit machine, rather than on a 32-bit one.
Therefore, specifying that C # int or long can be equivalent to C ++ int or long is incorrect.
Rather, C # has a type called IntPtr that was created exclusively for P / Invoke. Indeed, this size changes its size from 4 bytes on a 32-bit machine to 8 bytes on a 64-bit machine, and therefore it is the correct equivalent of C ++ unsigned long or Windows ULONG .
Davide cannizzo
source share