[fpc-devel] 4 Byte Storage - how to map up?

Ozz Nixon ozznixon at gmail.com
Tue Jul 24 23:12:31 CEST 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180724/5ca65cf6/attachment.html>


More information about the fpc-devel mailing list