Mail Archives: djgpp/1998/12/01/03:44:19
On Mon, 30 Nov 1998, dalitz wrote:
> 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.
As others have explained, this is due to the differences in byte order
between HP and Intel CPUs.
You can use library functions `ntohs' and `ntohl' to convert the byte
order of, respectively, 16-bit shorts and 32-bit ints.
- Raw text -