Date: Thu, 9 May 1996 17:47:42 +0200 (IST) From: Eli Zaretskii To: j DOT aldrich6 AT genie DOT com Cc: djgpp AT delorie DOT com Subject: Re: i/o file handling - intege In-Reply-To: <199605091349.AA117369770@relay1.geis.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.