writing binary files to Sun workstation

S

ShihChun

Hi everyone,
I encounter a problem in writing binary files for Sun Solaris system.
The problem is I have an array (data type: double) need to be ported
from
PC to Sun Solaris workstation.
However, the binary files produced by fwrite will cause Sun read in
wrong data
Does anybody know how to solve it?
Thanks a lot
 
M

mlimber

Hi everyone,
I encounter a problem in writing binary files for Sun Solaris system.
The problem is I have an array (data type: double) need to be ported
from
PC to Sun Solaris workstation.
However, the binary files produced by fwrite will cause Sun read in
wrong data
Does anybody know how to solve it?
Thanks a lot

You don't give us any detail on how the data is incorrect, but I'll
hazard a guess that one system is big endian (Sun) and the other is
little endian (PC). Try reversing the byte order in each double.

Cheers! --M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top