Article View: comp.lang.c.moderated
Article #2528Re: Good C Interview questions?
From: Lawrence Kirby
Date: Sat, 06 Apr 1996 14:52
Date: Sat, 06 Apr 1996 14:52
23 lines
1268 bytes
1268 bytes
In article <4jv7ri$dam@solutions.solon.com>
mholcomb@BIX.com "marty Holcomb" writes:
>Bill Wendling wrote:
> >} Why isn't the size 2*sizeof(int)+2*sizeof(char)?
> >
> >Byte alignment?
> >
> >} How could you decrease the size of the structure without removing
> >} any members?
> >
> >Rearrange the elements.
> >
>Aren't these questions platform dependent?
The exact details are platform dependent. However the general approach for
minimising the structure size is widely applicable.
--
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
Technical Details
Message-ID:
<4k60f2$adp@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4jmcn5$lq6@solutions.solon.com> <4jv7ri$dam@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: Lawrence Kirby <fred@genesis.demon.co.uk> Newsgroups: comp.lang.c.moderated Subject: Re: Good C Interview questions? Date: 6 Apr 1996 08:52:18 -0600 Organization: none Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4k60f2$adp@solutions.solon.com> References: <4jmcn5$lq6@solutions.solon.com> <4jv7ri$dam@solutions.solon.com> Reply-To: fred@genesis.demon.co.uk NNTP-Posting-Host: solutions.solon.com X-Newsreader: Demon Internet Simple News v1.27 X-Mail2News-Path: genesis.demon.co.uk