Massimiliano Cialdi <massimiliano.cialdi@xxxxxxxxxxxx> writes: > Il giorno mer, 04/08/2010 alle 10.35 +0100, Andrew Haley ha scritto: >> > I never read or write data poined by p. I only use it to calculate >> > offset of fields inside it. >> >> It's still pretty dubious. Why not use offsetof? > offsetof is defined as follows: > #define offsetof(st, m) \ > ((size_t) ( (char *)&((st *)(0))->m - (char *)0 )) Where is that definition? When using gcc, you should use the <stddef.h> which gcc provides. In that file, offsetof is defined as #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) Ian