I'm struggling to find a definitive answer for this: are long int and int virtually synonymous now? Some sites give the same ranges and sizes (in bytes) for the two, suggesting that they are effectively the same. Is it platform and compiler dependent?
Back in the days when we programmed 32 bit system I would have agreed that they mostly were the same on the most popular platforms/compilers, but lately with 64 bit coming of age I am seeing that int is often 32 bit and long is 64.
By the standard though, the only guarantee made is that long is at least as big as int.
Darryl wrote:By the standard though, the only guarantee made is that long is at least as big as int.
The standard also guarantees that long can represent integers in the range [-2147483647,2147483647]. In practice this means that they are at least 32-bit integers. Note that ints can be 16-bit integers.