Re: Big Endian - Little Endian
On Aug 31, 2:38 pm, Juha Nieminen <nos...@thanks.invalid> wrote:
James Kanze wrote:
(OTOH, would endianess have any meaning in a system where they have
the same size?)
Does it really have any meaning internally even when the sizes
are different?
If you write some values to a file eg. with fwrite(), it can
make a difference.
I'm afraid I don't understand. fwrite() really doesn't do
anything that ostream::write() doesn't; it just has an interface
which pretends to. If you have to reread the file at some
future date, possibly with a different program, or a new version
of the same program, then you have to write (and read) a
specified format. Neither fwrite() nor ostream::write() do
this; neither really make much sense unless the argument is a
preformatted buffer (except for the case where you are using the
file as extended memory within the program---frequent back in
the days of 8 or 16 bit processors, and a total memory of only
64 KB, but I can't imagine the need today, with 64 bits virtual
address space).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34