delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/28/16:13:34

From: "Technophile" <technophile AT NOSPAMemail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Structure padding
Date: 27 Dec 1999 00:57:25 EST
Organization: Concentric Internet Services
Lines: 37
Message-ID: <846v45$aqj@journal.concentric.net>
References: <Pine DOT LNX DOT 4 DOT 10 DOT 9912231627160 DOT 857-100000 AT syscon DOT minilinux DOT org> <83vh92$tcu$1 AT newsg1 DOT svr DOT pol DOT co DOT uk>
NNTP-Posting-Host: ts003d44.gre-sc.concentric.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

That's because it differs from machine to machine, depending on the
compiler....  Use sizeof() in a little demo program to find out the sizes
are for your box.  For instance, something similar to the following will
give you the values (in total bytes) of each type.

// begin code block
#include <iostream.h>

int main()
{
    cout << "An integer holds " << sizeof(int) << " bytes of data.\n";
    cout << "A short holds " << sizeof(short) << " bytes of data.\n";
    // you get the picture, yes?  ;)
return 0;
}
// end code block

Hope that helps.

.Tek
technophile AT email DOT com


Ghalos <greg AT holdridge7 DOT freeserve DOT co DOT uk> wrote
> really? Wotsit's Format gave me four bytes as the value...
>
> --
> Ghalos - greg AT holdridge7 DOT freeserve DOT co DOT uk
> Wilmer van der Gaast wrote in message ...
> >On Wed, 22 Dec 1999, Ghalos wrote:
> >
> >>    int  flags;
> >     ^^^
> >Btw. According to the FLI-specs in PCGPE this one should be two bytes,
> >not four.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019