🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #15339

Re: probleem met structuur

#15339
From: Frans Bouma
Date: Sun, 15 Oct 2000 00:00
29 lines
1663 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?

    BYTE is een #define van int.

    doe:
    typedef unsigned char byte
    
    typedef struct
    {
        byte var1;
        DWORD var2;
    } _test;

    et voila, 5 bytes

        FB
Technical Details
Message-ID: <8sd8mu$2ja$1@news1.xs4all.nl>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <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: "Frans Bouma" <perseus@xs4all.nl>
Subject: Re: probleem met structuur
Date: 2000/10/15
Message-ID: <8sd8mu$2ja$1@news1.xs4all.nl>
X-Deja-AN: 681826859
Content-Transfer-Encoding: 7bit
Sender: perseus@11dyn19.dh.casema.net
References: <UljG5.29720$s31.471928@afrodite.telenet-ops.be>
X-Priority: 3
Content-Type: text/plain; charset="Windows-1252"
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-Complaints-To: abuse@xs4all.nl
X-Trace: news1.xs4all.nl 971646494 2666 212.64.56.19 (15 Oct 2000 21:48:14 GMT)
Organization: Solutions Design
X-MSMail-Priority: Normal
Mime-Version: 1.0
Reply-To: "Frans Bouma" <perseus@xs4all.nl>
NNTP-Posting-Date: 15 Oct 2000 21:48:14 GMT
Newsgroups: be.comp.programming,nl.comp.programmeren