I am building a DLL which will be used by C++ using COM.
Please let me know what would be the C# equivalent of C++ 64-bit unsigned long long.
Will it be ulong type in C# ? Please confirm.
Thanks, Gagan
I am building a DLL which will be used by C++ using COM.
Please let me know what would be the C# equivalent of C++ 64-bit unsigned long long.
Will it be ulong type in C# ? Please confirm.
Thanks, Gagan
For anything that goes beyond ulong, you might as well use the C# BigInteger Structure.
In C++, the size of integer types varies depending on whether the program is running on a 32- or 64-bit machine, whereas C# integer types are platform-independent. So, they're not interoperable.
Rather, in C# there are the IntPtr and UIntPtr types, which are intended for P/Invoke, and whose size is 4 bytes on 32-bit machines and 8 bytes on 64-bit machines, which makes them equivalent to the C++ signed long and unsigned long types, respectively.
Since C++11, you can use these:
int8_tint16_tint32_tint64_tuint8_tuint16_tuint32_tuint64_tTheir size is guaranteed to remain the same regardless of anything.