What is the difference between unsigned long
and UINT64
?
I think they are the same, but I'm not sure.
The definition of UINT64
is :
typedef unsigned __int64 UINT64
(by using StdAfx.h)
h> header) defines uint64_t as unsigned long long , because unsigned long isn't wide enough. In 64-bit mode, it defines uint64_t as unsigned long . It could have defined it as unsigned long long in both modes. The choice is arbitrary; all that's required is that it has to be a 64-bit type.
The UInt64 value type represents unsigned integers with values ranging from 0 to 18,446,744,073,709,551,615. Important. The UInt64 type is not CLS-compliant. The CLS-compliant alternative type is Decimal. Int64 can be used instead to replace a UInt64 value that ranges from zero to MaxValue.
A unsigned long long int is not standardised across all systems so the size can change depending on the system running the code. A uint64_t is standardised in c++ and guarantees 64bits of storage, you need to include stdint. h to use it though.
Int64 is used to represents 64-bit signed integers . UInt64 is used to represent 64-bit unsigned integers.
UINT64 is specific and declares your intent. You want a type that is an unsigned integer that is exactly 64 bits wide. That this may be equal to an unsigned long on some platforms is coincidence.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With