Hej,
the code snippet below reveals the byte size of the struct (see also script attached)
struct record_t {
Int_t x;
Int_t y;
Int_t z;
} rec;
cout << "Record Length=" << sizeof(rec) << endl;
On my 32 bit linux machine I get the length = 12 when I compile the program. CINT however gives me 16. I figured that the size in CINT is always multiple of 8, although the size of the Int_t type is 4 bytes as it should be.
The discrepancy of the record length is particularly annoying when reading the same binary file both with a compiled and a CINT interpreted program. Is there a way to get the same record length for any simple struct?
Thanks in advance for your support,
Jörn.
reclen.C (277 Bytes)