offsetof macro — Computes member offset
size_t offsetof(type
,member-name
)
The offsetof
macro returns
the offset, in bytes, of a member of a struct
as a constant integer. The
type
must be a plain, C-style struct
(Plain Old Data, or POD), and the
expression &(t
.member-name
)
must be an address constant,
assuming t
is an instance of
type
. In particular, this means the
member-name
must not be a bit-field, a
static member, or a function member. (See Chapter 6 for more information about
POD types.)