Help with C between 68000 & 80286

Steve Summit scs at adam.mit.edu
Tue Aug 7 12:34:29 AEST 1990


In article <Aug.5.14.43.00.1990.26343 at pilot.njin.net> lodzins at pilot.njin.net (Dean Lodzinski) writes:
>I have numerous datafiles that were
>created using Mark Williams C on a 68000 machine.  I am trying to read
>in the data files using Power C 2.0 or Quick C 2.5 on my AT.  Since
>Intel reads the bytes differently, I can't directly use the data.

It may be best to convert the files to ASCII (using printf %d,
%e, etc.), transport them, and then read them in (or convert them
back) with scanf and/or atoi, atol, atof, etc.  You may find
yourself wishing that the data files had been written in a text
format originally (I certainly would, if I were stuck with this
problem).  ASCII text data files are usually preferable for this
very reason (and for several other reasons).  Some will claim
that ASCII storage, with its inherent formatting on output and
parsing on input, is too inefficient, but this is often not true
in practice.

I think I'll add this to the FAQ list; it comes up all the time.
(Worry not, efficiency hackers, I'll try not to editorialize in
favor of ASCII storage too much.)

                                            Steve Summit
                                            scs at adam.mit.edu



More information about the Comp.lang.c mailing list