M
mazsx
Is there a portable way to use binary files?
By portability I mean:
Machine A (a supercomputer) with some compiler, my job runs there and
outputs several megabytes of data. To save space and for better
seekability, I use a binary format.
Machine B (my desktop) with some other compiler analizes this data.
So far I assumed that both architectures have the standard
representation of the float, double and int types.
I would like to use now structs, where the programs compiled for the
two machines may use different
representation, even if they both obey to the same (implementation
defined) arithmetic standard.
Can one still use structs in fread/fwrite, or only a member-by-member
input/output is possible.
By portability I mean:
Machine A (a supercomputer) with some compiler, my job runs there and
outputs several megabytes of data. To save space and for better
seekability, I use a binary format.
Machine B (my desktop) with some other compiler analizes this data.
So far I assumed that both architectures have the standard
representation of the float, double and int types.
I would like to use now structs, where the programs compiled for the
two machines may use different
representation, even if they both obey to the same (implementation
defined) arithmetic standard.
Can one still use structs in fread/fwrite, or only a member-by-member
input/output is possible.