Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Mar 1998 14:16:41 -0500
From:      Geoffrey Robinson <grobin@accessv.com>
To:        questions@FreeBSD.ORG
Subject:   sizeof(struct whatever) doesn't add up
Message-ID:  <35059199.3E101A99@accessv.com>

next in thread | raw e-mail | index | archive | help
I've started working on a CGI in C that uses large structures (over 1kb)
to hold statistics. I've noticed in previous projects that when I
attempt to get the size of a structured variable the value sizeof()
returns is usually a few bytes more than the sum I get if I manually add
up the sizes of the structure members. Since it worked anyway I passed
the extra bytes off as something that C needed to keep track of the
structure. But now that I'm using much bigger structures the extra bytes
account for as much as 50% of one of my structures. There is no mention
of anything like this in my C text. What are those extra bytes and, if
possible, how do I get rid of them? 

Thanks.
--- 
Geoffrey Robinson
grobin@accessv.com
Oakville, Ontario, Canada.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35059199.3E101A99>