Article View: be.comp.programming
Article #15336Re: probleem met structuur
From: KLinZ
Date: Sun, 15 Oct 2000 00:00
Date: Sun, 15 Oct 2000 00:00
36 lines
1464 bytes
1464 bytes
Scorpion <scorpion@nospam.be> wrote in message
news:UljG5.29720$s31.471928@afrodite.telenet-ops.be...
> Ik heb volgende structuur:
>
> typedef struct {
> BYTE var1;
> DWORD var2;
> } _test;
>
> Normaal gezien neemt deze structuur 5 bytes in beslag.
> In VC6 neemt ze echter 8 bytes in beslag.
> Na de eerste byte komen nog drie bytes waarschijnlijk om op een DWORD uit
te
> lijnen?
> Kan ik dit uitlijnen ergens uitzetten zodat deze structuur toch maar 5
bytes
> in beslag neemt?
>
> Thanks!
>
Met deze code is dat mogelijk:
#pragma pack(push)
#pragma pack(1)
typedef struct {
BYTE var1;
DWORD var2;
} _test;
#pragma pack(pop)
Joris
Technical Details
Message-ID:
<3MlG5.19859$Z7.336199@nlnews00.chello.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<UljG5.29720$s31.471928@afrodite.telenet-ops.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: 107324,f57e95232f06f286 X-Google-Attributes: gid107324,public X-Google-Thread: fcea4,f57e95232f06f286 X-Google-Attributes: gidfcea4,public From: "KLinZ" <klinz@NOSPAMhetnet.nl> Subject: Re: probleem met structuur Date: 2000/10/15 Message-ID: <3MlG5.19859$Z7.336199@nlnews00.chello.com> X-Deja-AN: 681747793 References: <UljG5.29720$s31.471928@afrodite.telenet-ops.be> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@chello.nl X-Trace: nlnews00.chello.com 971630719 212.187.71.152 (Sun, 15 Oct 2000 16:25:19 GMT) Organization: None X-MSMail-Priority: Normal NNTP-Posting-Date: Sun, 15 Oct 2000 16:25:19 GMT Newsgroups: be.comp.programming,nl.comp.programmeren