Consider the following code :
unsigned char byte = 0x01;
In C/C++
the hexadecimal will be considered as an int
, and therefore will be expanded to more then one byte. Because there is more then one byte, if the system uses little or big endian has effect. My question is to what this will be expanded?
If the system has int
that contains 4 bytes, to which of the following it will be expanded :
0x00000001 OR 0x01000000
And does the endianness effect to which of them it will be expanded?