Ozz Nixon
2018-07-24 21:12:31 UTC
I am trying to access a file written to disk with 2 Singles (4 bytes each,
8 bytes total).
Linux: hexdump -Cv database.dat
00 00 00 81 00 00 00 81
The value saved in C, is 1 for both fields (low record #) and (high record
#).
In Pascal, if I do the same write using Longint, I get:
01 00 00 00 01 00 00 00
If I do the same write using Single, I get:
00 00 80 3F 00 00 80 3F
Before I write a mask/swap and only be right part of the time - is there a
setting that I need to enable/do so I can read/write C binary and work fine?
Thank you,
Ozz
8 bytes total).
Linux: hexdump -Cv database.dat
00 00 00 81 00 00 00 81
The value saved in C, is 1 for both fields (low record #) and (high record
#).
In Pascal, if I do the same write using Longint, I get:
01 00 00 00 01 00 00 00
If I do the same write using Single, I get:
00 00 80 3F 00 00 80 3F
Before I write a mask/swap and only be right part of the time - is there a
setting that I need to enable/do so I can read/write C binary and work fine?
Thank you,
Ozz