what is the deference between int and long? I used sizeof() to check and they are the same in bytes.
Thanx in advance!
what is the deference between int and long? I used sizeof() to check and they are the same in bytes.
Thanx in advance!
How big each type is depends on the system it is being run on. C++ guarantees only the following:
sizeof(short) <= sizeof(int) <= sizeof(long)
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
My book says that long is suppose to take up twice the size of int (8 to 4) . int can store numbers from -2147486648 to +2147486648 while long can store numbers from -9223372036854775808 to +9223372036854775808. However, the book also noted that the size of each variable form is determined by the compiler's developers.
An Unofficial Cristiano Ronaldo Website : Ronaldo 7
Right... C++ doesn't guarantee the exact size of anything, not even the number of bits in a byte. So, it depends on the compiler, and the system in which you are compiling. Many old Windows compilers had 16-bit ints and 32-bit longs. Now, on many Windows compilers, both are 32-bits. Often, it also has to do with the size of the registers in your compiler.
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
You can also get numbers larger than those by using "unsigned"
This means that the range of numbers stays the same (I.e.):
-2147486648 to +2147486648 is a range of 4323273296 numbers.
"unsigned" tells it to ignore the negatives and begin counting at 0.
So, in the case of the above example:
"unsigned int X" would hold values from 0 to 4323273296.
But the range, again, depends on the compiler.
Absolutely. In addition, it does guarantee the minimum sizes. A short int and a 'plain' int will be at least 16 bits (-32767 to 32767), a long int will be at least 32 bits (-2147483647 to 2147483647).Originally posted by Zach L.
How big each type is depends on the system it is being run on. C++ guarantees only the following:
sizeof(short) <= sizeof(int) <= sizeof(long)