Date: Sun, 23 Feb 1997 21:28:33 -0700 (MST) From: David May To: Delong cc: djgpp AT delorie DOT com Subject: Re: Help: My structure members aren't getting the right offsets! In-Reply-To: <3310E089.78F9@osha.igs.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 23 Feb 1997, Delong wrote: > I am trying to get the VBE implementation to return a VBEInfoBlock, and > VBEInfoBlock is supposed to be 512 bytes long, but the structure I > defined after the VBE 2.0 specs to have 512 bytes (I counted them) is > turning out to be 516 bytes long! > The FAQ explains this (I'm not at a DOS box now so I can't grep it to tell you where. Anyway, structures are padded by DJGPP for performance reasons. This is typically not a problem because it is done so consistently. However, there are times when structres are used to access files that are of a particular format (like dBASE III files) and these are not padded the way DJGPP would. There are a few solutions here. The one I use (which some on this list have said is "evil" - sorry :) is to use a #pragma pack(1) before the declaration of the structure you want packed. The FAQ gives other solutions to this problem. Hope this helps. David May ID Card Adminstrator Albuquerque TVI