hi everyone is any one knows whats the diffrence between unsigned long to UINT64 i think its the same , but im not sure. the defenition of UINT64 is : typedef unsigned __int64 UINT64 (By Using StdAfx.h)
thanks.
hi everyone is any one knows whats the diffrence between unsigned long to UINT64 i think its the same , but im not sure. the defenition of UINT64 is : typedef unsigned __int64 UINT64 (By Using StdAfx.h)
thanks.
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.
The built-in long
type can vary according to platform. On a 32-bit platform like Windows, a long
will be 64 bits, but you cannot assume that this will be the case on other platforms.
UINT64
is always guaranteed to be 64 bits.
The unsigned long
type size could change depending on the architecture of the system you are on, while the assumption is that UINT64
is definitely 64 bits wide. Have a look at http://en.wikipedia.org/wiki/C_variable_types_and_declarations#Size
See http://msdn.microsoft.com/en-us/library/s3f49ktz(VS.90).aspx
You want to see the difference between unsigned long
and unsigned __int64
.
A long is typically 32 bits (but this may very per architecture) and an uint64 is always 64 bits. A native data type which is sometimes 64 bits long is a long long int
.
The C++ standard does not define the sizes of each of the types (besides char
), so the size of unsigned long
is implementation defined. In most cases I know of, though, unsigned long
is an unsigned 32 bit type, while UINT64
(which is an implementation type, not even mentioned in the standard) is a 64 bit unsigned integer in VS.