Mail Archives: djgpp/1998/11/30/19:45:56
On Mon, 30 Nov 1998, dalitz wrote:
> I observed an unexpected behavior of fread.
> It seems to me that the order of two subsequent bytes
> is swapped in the buffer when the fread function reads items of
> two bytes (short int). I really don't understand what's going
> on.
Didn't you know things like little endian and big endian?
a PC is big endian, and I'm pretty sure that the HP-PA architecture works
the other way...
Like someone else replied, try to read your file one byte at a time, or a
bunch of bytes in an array of unsigned chars, and build your own integers
by yourself...
--
Erwann ABALEA
eabalea AT certplus DOT com
- Raw text -