Mail Archives: djgpp/1997/12/31/02:54:53
On Tue, 30 Dec 1997, Dave Nugent wrote:
> Can someone explain to me why I have a file that was created in Borlands
> Turbo C++ v3.0 that wrote a bunch of integers can't be read properly in
> DJGPP?
An int is 16 bit in Borland C, but DJGPP uses 32-bit ints, that's
why. Use short in DJGPP to get a 16-bit int.
Note that it is usually a *very* bad idea to share binary data between
different compilers, as they have their private trick of laying out
data in memory. The speed gain in reading binary data is IMHO not
worth the hassle you get to make code that reads binary data work with
another compiler. Make your files ASCII and live happily ever after.
- Raw text -