delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/13/19:53:04

Message-ID: <376444AF.5A499D84@melbpc.org.au>
Date: Mon, 14 Jun 1999 09:54:23 +1000
From: Peter Russell <petrer AT melbpc DOT org DOT au>
Organization: Melbourne PC User Group
X-Mailer: Mozilla 4.6 [en] (Win95; I)
X-Accept-Language: en,ru
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com
Subject: Re: fread
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990610185220 DOT 20445C-100000 AT is>
Reply-To: djgpp AT delorie DOT com

I also found that that the said binary file I was trying to read had been
written by a compiler with 16 bit int. Djgpp is 32 bit int. However problem
solved .

Thanks regards Pete

Eli Zaretskii wrote:

> On Thu, 10 Jun 1999, Peter Russell wrote:
>
> > I'd like some info on what I am doing wrong here. This block of code
> > works perfectly in Borland C 3.1 and in MS QC ver 6 but gives an
> > erroneous result in DJGPP. It reads a binary file into an array of
> > structures and displays to screen.
>
> Was the file written by a DJGPP program that declared the BOOK structure
> in the same manner?
>
> If not, then what you see is a result of padding struct members which is
> done differently by different compilers.  See section 22.10 of the DJGPP
> FAQ list for more details.

- Raw text -


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