From: Bruno H. <br...@cl...> - 2017-05-26 08:44:05
|
Compro Prasad wrote: > According to what I have seen, 32 bit systems have sizeof(long) as 32 > bits and on 64 bit systems it is 64 bits. On 64-bit native Windows, 'long' is 32 bits, not 64 bits. That is, 'long' can be smaller than a 'void *'. > So, why trust "long". The code trusts the type whose width it has determined. The point of the 'uint32', 'uint64' types is to use *not* make assumptions about the width of a specific type such as 'int' or 'long'. Computer architectures evolve. > Why not use "int" for 32 bits and "long long" for 64 bits? If there is a > problem then what is it? Until recently (2015), you could not use 'long long' portably. Now, finally, MSVC has this type too. Bruno |