delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/09/06:46:03

From: Emyr DOT James AT astro DOT cf DOT ac DOT uk (Emyr James)
Newsgroups: comp.os.msdos.djgpp
Subject: Problems with fread and fwrite
Date: 1 Oct 1997 14:07:28 GMT
Organization: Dept. of Physics & Astronomy, Cardiff University, Wales
Lines: 12
Message-ID: <60tlf0$7d3$1@loki.cf.ac.uk>
Reply-To: Emyr DOT James AT astro DOT cf DOT ac DOT uk
NNTP-Posting-Host: crystal.astro.cf.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I am trying to get djgpp to do a raw memory dump to a file. I wrote the following
small program to output 1000 double float variables. The file produced should be
exactly 8000 bytes long. However, the program produces files with lengths that vary
each time but are typically 8020 bytes long. Needless to say, replacing the fwrite
to an fread to read in the file produces garbage. What is going on ??
Is there another way of doing it ? 
I tried the program with gcc 2.6.3 on a Sun workstation and that works ok (i.e 
output files are 8000 bytes long and can be read in to give meaningful values).
HELP!!!!



- Raw text -


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