C
Carl Muller
In C++, the amount of memory used to store int is 4 bytes,
On the compiler/cpu I use, int uses 1 byte, but the byte has 16 bits
so it can hold a value between -32768 and 32767.
So sizeof(char) == sizeof(short) == sizeof(int) == 1 which is 16 bits,
but sizeof(long) == 2 which is 32 bits.
This is valid (but not common) for both the C and C++ standards.
or dependent upon the hardware?
On the compiler/cpu I use, int uses 1 byte, but the byte has 16 bits
so it can hold a value between -32768 and 32767.
So sizeof(char) == sizeof(short) == sizeof(int) == 1 which is 16 bits,
but sizeof(long) == 2 which is 32 bits.
This is valid (but not common) for both the C and C++ standards.