I learned the range of int and long on 32 bit windows is:
signed int: -32767 to 32767
signed long: -2147483647 to 2147483647
why does the int has same range as long type as mentioned on msdn?
http://msdn.microsoft.com/en-us/library/s3f49ktz%28VS.80%29.aspx
I assume you meant to write this:
They are the same for entirely historical reasons. The C++ standard doesn’t mandate a particular size for each type, the only guarantee between these two types is that
sizeof(int) <= sizeof(long).