That was my point: Bit shifts (or arithmetic with '/' and '%' operators) allow you to extract the bytes whatever order you require. (Not endian-dependent.)Originally Posted by Exile
The shift and arithmetic operators work on numbers in registers. Upper bits are upper bits; lower bits are lower bits.
When the individual bytes get stored in memory, the byte order is dependent on the endianness of the machine. This shows up with different results for bid-endian systems and little-endian systems using the union.
Regards,
Dave