All of lore.kernel.org
 help / color / mirror / Atom feed
* structure size
@ 2003-03-05  7:02 Mohammed Khalid Ansari
  2003-03-05  8:27 ` Helmut Djurkin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Mohammed Khalid Ansari @ 2003-03-05  7:02 UTC (permalink / raw)
  To: linux c programming mailing list


Hi,

why the sizeof sturcture is alway greater than the collective sizes of all 
the elements in it.

eg
struct node {
	int	a;
	char	c;
	int	b;
};

int main()
{
	printf ("%d\n", sizeof (struct node));
	return 0;
}


it prints 12 in my case.

where is the catch.

-- 

**************************************************************************

Mohammed Khalid Ansari                    Tel (res) : 0091-022-3051360
Assistant Manager II                          (off) : 0091-022-2024641
National Centre for Software Technology   Fax       : 0091-022-2049573 
8th flr,Air India Build. Nariman Point,   E-Mail    : khalid@ncst.ernet.in 	
Mumbai 400021.

Homepage : http://soochak.ncst.ernet.in/~khalid			  	  

**************************************************************************


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <65256CE0.00269E0A.00@sandesh.hss.hns.com>]

end of thread, other threads:[~2003-03-25 10:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-05  7:02 structure size Mohammed Khalid Ansari
2003-03-05  8:27 ` Helmut Djurkin
2003-03-25 10:00   ` strange SIGSEGV Alexi Jordanov
2003-03-05  9:06 ` (F)structure size Steven Smith
2003-03-12 22:49 ` getlogin(), prints ((NULL)) when printing multiple times in a row J.
2003-03-12 23:14   ` Glynn Clements
2003-03-13  0:18     ` getlogin(), prints ((NULL)) solved.. thnkx.. glen J.
     [not found] <65256CE0.00269E0A.00@sandesh.hss.hns.com>
2003-03-06  4:03 ` structure size Mohammed Khalid Ansari

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.