Date: Thu, 23 Dec 1999 09:39:01 +0200 (WET) From: Andris Pavenis To: Ghalos cc: djgpp AT delorie DOT com Subject: Re: Structure padding In-Reply-To: <83rc56$ppp$1@news6.svr.pol.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 22 Dec 1999, Ghalos wrote: > I have a problem loading the header for an FLI file.... it should be 128 > bytes like this: > #pragma pack(1) > struct fli_file_header_s > { > int size; > short magic; > short frames; > short width; > short height; > short depth; > int flags; > short speed; > int next; > int frit; > char expand[100]; > } #pragma pack() > > Problem is.... DJGPP pads this out to take up 132 bytes! I guess this is to > keep everything nicely aligned but I can't read it in from the file > correctly if this happens... how can I stop it?? > Using #pragma pack(1) and #pragma pack() is one (but not only) of the ways how to do that