hey all,
If my machine is a different endianess from the file I'm reading, how do I go about switching the bytes?
Ex:
machine = little endian
file = big endian
file
0001
If i read this file normally, as an unsigned int, then I will come up with the value 4, because it will read it as 0100. I need it to read as 0001 and come up with the value 1.
Any suggestions?
thanks,
Jon
If my machine is a different endianess from the file I'm reading, how do I go about switching the bytes?
Ex:
machine = little endian
file = big endian
file
0001
If i read this file normally, as an unsigned int, then I will come up with the value 4, because it will read it as 0100. I need it to read as 0001 and come up with the value 1.
Any suggestions?
thanks,
Jon