Mail Archives: djgpp/1996/05/09/11:00:21
On Thu, 9 May 1996 j DOT aldrich6 AT genie DOT com wrote:
> >What is the appropriate way to read/write integers from/to a file with the
> same
> >size as it is stored in
> >memory, i.e. a long integer (32bit) would occupy 4 bytes in the file. I have
> >reached a solution but it seems
This thread is going on for so long, that another bit of info, however
insignificant, won't hurt anybody. So here goes: did you know there are
functions specifically designed to read and write 32-bit words? Well,
there are, they are called `getw' and `putw'. Look them up in the libc
Info reference. Warning: they are neither ANSI nor POSIX, so don't use
them in a program that should be portable.
- Raw text -