| www.delorie.com/archives/browse.cgi | search | 
| Message-ID: | <32A85B15.4015@skygames.com> | 
| Date: | Fri, 06 Dec 1996 09:42:45 -0800 | 
| From: | Kevin Baca <kbaca AT skygames DOT com> | 
| Organization: | BlueSky Software | 
| MIME-Version: | 1.0 | 
| To: | djgpp AT delorie DOT com | 
| Subject: | Re: Padding Question | 
| References: | <32A810D9 DOT 366E9B4E AT m-net DOT arbornet DOT org> | 
Rohit Jalan wrote:
> 
> Hi !!
> 
> Is it possible to stop gcc from padding structures ?
> 
> Thnx.
> Rohit
> <rohitj AT hotmail DOT com>
#pragma pack(1)  /* use one byte as minimum packing size */
struct foo
{
   int i;
   char c;
   int j;
};
#pragma pack(2)  /* use two bytes as minimum packing size */
struct bar
{
   int k;
   char d;
   int x;
};
#pragma pack()  /* use default packing */
-Kevin
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |