Mail Archives: djgpp/1994/07/29/07:34:27
Hello,
I have trouble reading binary floating point data (4bytes/value) from a
file generated on a sun/unix into my code compiled with djgpp.
If I compile and run my code on my sun as well, I have no problem: the
code I use is
float data[...] ;
File *file ;
....
fread(data,sizeof(float),ns,file) ;
It doesn't seem to matter whether I open the file as "r" or "rb", whether
I compile with cc or gcc, it all works. If I now compile the same source
with djgpp on my pc, the values that are read from the same file are not
read as proper floats (sizeof(float) is still 4bytes). Do I need to swap
some bytes, has anyone encountered this and knows what the proper format
conversion is between floats in djgpp and floats under unix?
Many thanks, Leendert.
- Raw text -