Doing the following fixed the issue:
typedef struct InvoiceRow {
uint INVOICE_NUMBER;
...
double GROSS __attribute__((packed));
...
Type: Posts; User: Aaron Jackson
Doing the following fixed the issue:
typedef struct InvoiceRow {
uint INVOICE_NUMBER;
...
double GROSS __attribute__((packed));
...
I just read about this Data structure alignment - Wikipedia, the free encyclopedia ... I am assuming it is related?
Hey. offsetof is a pretty useful tip, thanks.
It has showed me that GROSS is type bytes off where I would have thought it would be. This is especially strange though because changing "double...
The size is as expected, and writing the struct back out to a file results in exactly the same data as the file I read from. Kinda weird.
The value which the double was being set to appeared to...
Hi all,
I am parsing a binary data file by casting a buffer to a struct. It seems to work really well apart from this one double which is always being accessed two bytes off, despite being in the...