delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/07/29/13:12:37

Date: Fri, 29 Jul 94 09:47:52 -0400
From: dj AT ctron DOT com (DJ Delorie)
To: combee AT cambridge DOT scr DOT slb DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: help with reading floats from file

> 
>   I have trouble reading binary floating point data (4bytes/value) from a
>   file generated on a sun/unix into my code compiled with djgpp.

For starters, Suns are big-endian and i386 are little-endian, so
binary formats in general (even integers) are not going to be
compatible.

Secondly, floating point binary formats aren't guaranteed to be the
same across platforms.

You're best bet is to convert the values to strings for file storage.



- Raw text -


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