I thought you were simply looking for code portability. You must never
send a binary stucture across a network. Even if you get the sizes
correct, you'll have endian problems when running different
architectures (PC vs Mac). You must manually ship the data bytes in a
defined order and reconstruct
So the data should include a flag to tell what endian form it is, and
the code should be written to support both ways? Image file formats
specify and endianness in the specification, not the files. If it's in
the files, then you'd need code to handle both ways...
On Sun, 2005-03-27 at 09:28
Don't ever assume that all the components of a structure will be at the
same location within the struct on all architectures, or that the
structure size will be the same. Processor architecture, language used,
compiler, and compiler flags all can change how a structure is packed.
That usually
On Mar 27, 2005, at 3:20 PM, Miles Gazic wrote:
Don't ever assume that all the components of a structure will be at the
same location within the struct on all architectures, or that the
structure size will be the same. Processor architecture, language
used,
compiler, and compiler flags all can