Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!aspect!dave From: dave@aspect.UUCP (Dave Corcoran) Newsgroups: comp.lang.c Subject: Help needed with: sizeof (struct a) Keywords: sizeof,struct,help,cc Message-ID: <10569@aspect.UUCP> Date: 19 Jun 91 17:07:13 GMT Organization: Aspect Telecommunications, San Jose, Ca Lines: 25 printf("Hello World\n"); My Sun cc prints 4 for both structs, prints 3 for the array -----------------8<-------------------- struct a {char x;char y;char z}; struct b {char x[3]}; char c[3]; main() { printf("%d\n",sizeof (struct a)); printf("%d\n",sizeof (struct b)); printf("%d\n",sizeof c); } -----------------8<-------------------- Is there any way to cause cc to force sizeof return the actual size of the structs without rounding up to the next highest sizeof (short)? Thanx -- David Corcoran -@@ uunet!aspect!dave ~ Having the right to do something is not the same as being right in doing it. -- C.K. Chesterson