delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/08/10:08:55

Xref: news2.mv.net comp.os.msdos.djgpp:3562
From: Roland Exler <R DOT Exler AT jk DOT uni-linz DOT ac DOT at>
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
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019