D
Derrick Coetzee
David said:struct foo
{
char bar;
long baz;
};
How can I know exactly how many bytes into struct foo baz is?
This is what the offsetof macro, defined in <stddef.h>, is for (ref C99
7.17.3). However, if your program's behaviour relies on this value, it
is fundamentally nonportable, even between different versions of the
same compiler. Don't use this for loading/saving, in particular.