delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/01/06:07:42

Date: Mon, 1 Aug 94 09:17:14 BST
From: devitto AT ferndown DOT ate DOT slb DOT com
To: djgpp AT sun DOT soe DOT clarkson DOT edu, enrico AT max DOT tiac DOT net
Subject: Re: Fread

 |Allright.  It seems that GCC pads it's structs with extra bytes in order to get proper alignment of it's long words.  This is all very fine and good, until I want to go and fread a structure written by a programme compiled with some other compiler.  Any suggestions?
 |

[ Don't write out structs using write/fwrite (ie as binary), it's unportable. ]

1) Read each field individually.
2) Read n records into memory, then copy the fields into the gcc structs.
   [ a little faster than (1) ]

Dom

- Raw text -


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