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 st
You could do this:
int x = 0x12345678; x = ( x >> 24 ) | (( x << 8) & 0x00ff0000 )| ((x >> 8) & 0x0000ff00) | ( x << 24) ; printf("value = %x", x); // x will be printed as 0x78563412