Xref: news2.mv.net comp.os.msdos.djgpp:3562 From: Roland Exler Newsgroups: comp.os.msdos.djgpp Subject: Re: i/o file handling - integers Date: Wed, 08 May 1996 07:48:52 -0700 Organization: Institute for el. Measurement, University of Linz, Austria Lines: 10 Message-ID: <3190B454.3657@jk.uni-linz.ac.at> References: <318E71BD DOT 904 AT algonet DOT se> NNTP-Posting-Host: sensor4.emt.uni-linz.ac.at Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Rikard Thunberg 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 > rather clumsy: Use fwrite()/fread(). This functions takes the start and length of the block of memory you want to write or read. Roland