www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/06/21:54:23

From: "Groman" <groman AT thehelm DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Data padding?
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <rVad4.105$Ee4.3982@nnrp2-w.snfc21.pbi.net>
Date: Thu, 6 Jan 2000 17:01:18 -0800
NNTP-Posting-Host: 206.170.6.58
X-Complaints-To: abuse AT pacbell DOT net
X-Trace: nnrp2-w.snfc21.pbi.net 947206871 206.170.6.58 (Thu, 06 Jan 2000 17:01:11 PST)
NNTP-Posting-Date: Thu, 06 Jan 2000 17:01:11 PST
Organization: SBC Internet Services
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

hi... I need help with DJGPP again.
I have a struct...and I need djgpp to leave it the way I declare it without
any padding or aligning it to machine words...

for example

struct Lalala {
    unsigned int testing1;
    unsigned char testing2;
    unsigned short testing3;
    unsigned char testing 4;
}

int main(void)
{
    Lalala test1;
    test1.testing1 = 0xFFFFFFFF;
    test1.testing2 = 0xEE;
    test1.testing3 = 0xDDDD;
    test1.testing4 = 0xAA;
}

I want *test1* to look in memory like this:
0xFF 0xFF 0xFF 0xFF 0xEE 0xDD 0xDD 0xAA

just like this...is there any way to do that?

thank you for your help...




- Raw text -


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