The value of a signed long integer is +/- 2**31 +/-1 (i.e. values ranging from negative 2,147,483,647 to positive 2,147,483,647). The largest positive value is 7FFFFFFF (hexadecimal).
The value of an unsigned long integer is 0..4,294,967,295 equivalent to the range 00000000..FFFFFFFF (hexadecimal).
2006-07-24 11:51:52
·
answer #1
·
answered by Dave F 1
·
0⤊
0⤋
1. A long int is guaranteed to be atleast as big as an integer.
2. The int size is usually chosen to be the word-size of the underlying processor.
So, considering 1 and 2 above, the long int is atleast 4 bytes (32-bits) long.
However for bigger ints some compilers like SUN-CC and gcc provide long long int, and some like VC++ provide int64_t types.
2006-07-24 17:10:42
·
answer #2
·
answered by swami060 3
·
0⤊
0⤋
In C/C++, the byte size of each primitive is platform dependent so you need to do the sizeof(long) as mentioned above to get the size on your machine.
The "32-bit" system (assuming you are referring to the width of the address bus) only tells you the size of a pointer - which on 32-bit system is 32 bits or 4 bytes.
2006-07-24 12:48:03
·
answer #3
·
answered by Anonymous
·
0⤊
0⤋
A long integer is in the range -2,147,483,648 to 2,147,483,647
2006-07-24 11:52:50
·
answer #4
·
answered by payamazadi 2
·
0⤊
0⤋
It prints on my 32-bits PC:"Sizeof(long) = 4 bytes"
int main( int ac, char ** av )
{
printf( "Sizeof(long) = %d bytes\n", sizeof( long ));
return 0;
}
2006-07-24 11:49:03
·
answer #5
·
answered by alakit013 5
·
0⤊
0⤋