Date: Mon, 09 Dec 1996 09:57:44 +0000 From: Bill Currie Subject: Re: Padding Question To: tehmul%NIITPUN AT iris DOT ernet DOT in Cc: djgpp AT delorie DOT com Reply-to: billc AT blackmagic DOT tait DOT co DOT nz Message-id: <32ABE298.F11@blackmagic.tait.co.nz> Organization: Tait Electronics NZ MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <4C6D083001E72A00 AT iris DOT ernet DOT in> tehmul%NIITPUN AT iris DOT ernet DOT in wrote: > Yes. (I'm sure someone will tell you to RTFM :) But anyway, here goes: > > struct junk > { //structure details > } __attribute__((packed)); > > That ought to do it. But read the FAQ, there's a real wealth of info there. Unfortunatly, that only works in C. C++ requires you to put __attribute__((packed)) on all the members instead (or at the beginning of the structure, but that seems to have a bug and doesn't seem to work). If you code only for C and never expect the structure to be used in a c++ program, the above will work just fine. Bill -- Leave others their otherness.