[LCP]struct size

Roberto Diaz rdiazmartin at vivaldi.dhis.org
Wed Aug 22 06:14:04 UTC 2001


> struct x { char a; int b; char c; }; would take 12 bytes.

lets see:
	a: 1 byte, aligned 
	b: 4 bytes, to be aligned a hole of 3 bytes
	c: 1 byte, to be aligned a tail hole of 3 bytes

	char a; /* 3 bytes hole */ int b; char c; /* 3 bytes hole */

total 12 bytes..  

Regards

Roberto

------------------------------------------------------------------------
Roberto Diaz <rdiazmartin at vivaldi.dhis.org>
http://vivaldi.dhis.org
Powered by GNU running on a Linux kernel.
Powered by Debian (The real wonder)

Concerto Grosso Op. 3/8 A minor
Antonio Vivaldi (so... do you need beautiful words?)
------------------------------------------------------------------------




More information about the linuxCprogramming mailing list