Mail Archives: djgpp/2001/03/12/11:41:27
Igor Bujna <igor DOT bujna AT maxi-tip DOT cz> wrote:
> Hi,
[What on earth are all those Ctrl-O's doing there, at the end of each
line???]
> I have some programs under BCC version 4.5. And I have some binary
> files, when i want to compile my programs under djgpp is everything
> OK, but how can i convert my binary files from bcc to djgpp.
You don't strictly have to convert the files at all. You just have to
learn that you have to read them in a more careful way than by simply
saying
fread (&somestruct, sizeof(somestruct), file);
Doing it that way is about as bad an idea as gets, speaking of
portability of your program to other compilers, let alone other
hardware platforms.
Read your struct field by field, with fread() calls, be careful about
how large 'int' and all the other types *really* are, on each of the
participating compiler, and you can read the existing binary file in
DJGPP and BCC. You can even use the same source code, if you do it
right.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -