Does the C floating point number is architecture (big/little endian) independent?
Or I have to do sth. like this:
double theNumber = number2write; int32 *conv; conv = &theNumber; *conv = swap_2_BE_if_needed(*conv); conv++; *conv = swap_2_BE_if_needed(*conv); conv--; fwrite(conv, 4, 2, myFile);
and reverse when I read the number?
Pawel
C is architecture DEPENDENT.
If you need architecture independence, you can try programming in Java instead...
Log in to post a comment.
Does the C floating point number is architecture (big/little endian) independent?
Or I have to do sth. like this:
double theNumber = number2write;
int32 *conv;
conv = &theNumber;
*conv = swap_2_BE_if_needed(*conv);
conv++;
*conv = swap_2_BE_if_needed(*conv);
conv--;
fwrite(conv, 4, 2, myFile);
and reverse when I read the number?
Pawel
C is architecture DEPENDENT.
If you need architecture independence, you can try programming in Java instead...