Convert Little Endian to Big Endian
问题 I just want to ask if my method is correct to convert from little endian to big endian, just to make sure if I understand the difference. I have a number which is stored in little-endian, here are the binary and hex representations of the number: 0001 0010 0011 0100 0101 0110 0111 1000 12345678 In big-endian format I believe the bytes should be swapped, like this: 1000 0111 0110 0101 0100 0011 0010 0001 87654321 Is this correct? Also, the code below attempts to do this but fails. Is