Correct me if I am wrong,
int is 4 bytes, with a range of values from -2,147,483,648 to 2,147,483,647 (2^31)
long is 4 bytes, with a range of values from -2,147,
The C++ specification itself (old version but good enough for this) leaves this open.
There are four signed integer types: '
signed char
', 'short int
', 'int
', and 'long int
'. In this list, each type provides at least as much storage as those preceding it in the list. Plain ints have the natural size suggested by the architecture of the execution environment* ;[Footnote: that is, large enough to contain any value in the range of INT_MIN and INT_MAX, as defined in the header
. --- end foonote]