www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/08/13:00:26

From: "Matthew Conte" <spam AT somebody DOT else>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Sizeof messed up
Date: Mon, 8 Jun 1998 12:47:28 -0400
Organization: ICGNetcom
Lines: 14
Message-ID: <6lh4hu$3r2@sjx-ixn3.ix.netcom.com>
References: <357c0fc1 DOT 0 AT news DOT myna DOT com>
NNTP-Posting-Host: frm-ma4-14.ix.netcom.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Vimal N. Lad / Gautam N. Lad wrote in message <357c0fc1 DOT 0 AT news DOT myna DOT com>...

>For some odd reason, the sizeof function returns the wrong size.
>I have a structure, which is exactly 18 bytes long.  When I call
>sizeof(TGAHEAD); (I am trying to read the header of a .TGA file),
>it says the header is 20 bytes long.  I have the correct structure

Sounds like djgpp is padding your structure to a 4-byte boundary.  IIRC,
there's a section in the FAQ that addresses this.

Later,
Matt.


- Raw text -


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