zn->level
(a flexible array member) has some fixed offset w.r.t. zn
: if zn
is at address 0x10000
, then zn->level[0]
could be at address 0x10018
because the pointer robj
would occupy one 8byte word (assuming a 64 bits x86 machine) and the double score
would occupy another 8 byte word -and should be word aligned- and the pointer backward
would occupy another word. So zn->level
is offset by 3 words, i.e. 24 bytes (i.e. 0x18
in hex).
BTW, the compiler or ABI could insert gaps in your structure (for alignment or ABI compliance). In your particular example it probably would not (with GCC on Linux/x86-64).
You could be interested by the standard offsetof macro and of course the sizeof
"operator".