Mail Archives: djgpp/1996/12/10/17:05:35
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.
- Raw text -