www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/03/19:23:24

From: Eric Heft <eheft AT valhalla DOT cs DOT wright DOT edu>
Subject: [Q] Structs and spacing of data
To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Date: Wed, 3 May 1995 17:48:15 -0400 (EDT)

Hi,
   I've got a stuct like 

typedef struct {
   short id;
   char  fc[3];
   short pos;
   ...
} trREC,*tpREC;

when I go to read the struct from a binary file the struct
appears to have padded a space between then end of fc and
start of pos. Is there a pragma to make sure the struct uses
the minimum amout of space? How much of a speed penalty will
I pay in the rest of the code (hav'ing non-word boundries)?
Would it be better skip the pragma and just to read the
fields one at a time?

Thanks
   Eric


- Raw text -


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