From owner-freebsd-questions Tue Mar 10 11:16:48 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA00881 for freebsd-questions-outgoing; Tue, 10 Mar 1998 11:16:48 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from emerald.accessv.com (emerald.accessv.com [206.221.248.8]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA00798 for ; Tue, 10 Mar 1998 11:16:28 -0800 (PST) (envelope-from grobin@accessv.com) Received: from accessv.com (114.209.135.80.dialup.accessv.com [209.135.80.114]) by emerald.accessv.com (8.8.5/8.8.5) with ESMTP id OAA04288 for ; Tue, 10 Mar 1998 14:12:39 -0500 Message-ID: <35059199.3E101A99@accessv.com> Date: Tue, 10 Mar 1998 14:16:41 -0500 From: Geoffrey Robinson Reply-To: grobin@accessv.com X-Mailer: Mozilla 4.03 [en] (Win95; U) MIME-Version: 1.0 To: questions@FreeBSD.ORG Subject: sizeof(struct whatever) doesn't add up Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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