From: johnson AT cdsmn DOT mn DOT org (Erik Johnson) Subject: how do you pack structs? To: djgpp AT sun DOT soe DOT clarkson DOT edu Date: Mon, 4 Oct 93 12:46:58 CDT Is it possible to pack a struct, so that it uses the least amount of memory required for the data. example: struct { uchar reg; uchar *scr; uchar r,g,b; } RGB; Normally sizeof(RGB)==12. Is it possible to tell the compiler NOT to pad out structs to multiple-of-4 sizes. I understand that in the above example, swapping reg and scr would result in a sizeof()==8 (which is what I want), but when you are working with file headers that are not of your own design, you can not simply reorder your struct. Thank you, Erik R Johnson