Mail Archives: djgpp/1994/08/01/06:07:42
|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 -