delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/14/06:18:30

Date: Mon, 14 Jun 1999 13:15:57 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Sunil V <sunilv AT accord-soft DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: How does fwrite align ?
In-Reply-To: <3764C915.E63E4D8D@accord-soft.com>
Message-ID: <Pine.SUN.3.91.990614131501.3878D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 14 Jun 1999, Sunil V wrote:

> I have observed that when I use something like fwrite(&XXX,
> sizeof(struct X),  1, file_pointer);
> in  a loop, the next record is not written immediately after the first
> record. The next record is aligned to an int boundary ( that is what I
> observed on my m/c, where in the size of int is 4 bytes). Is there a
> hard and fast rule that dictates the way alignment has to be performed
> or is it dependent on the compiler or the architecture of the machine ?

See section 22.10 of the DJGPP FAQ list.

- Raw text -


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