- 论坛徽章:
- 0
|
本帖最后由 x5miao 于 2011-09-29 14:36 编辑
回复 149# asuka2001
C99对此的表述只有功能描述:
offsetof(type, member-designator)
which expands to an integer constant expression that has type size_t, the value of
which is the offset in bytes, to the structure member (designated by member-designator),
from the beginning of its structure (designated by type). The type and member designator
shall be such that given
static type t;
then the expression &(t.member-designator) evaluates to an address constant. (If the
specified member is a bit-field, the behavior is undefined.)
其实这个问题你只能回答“在...里面offsetof的实现是...,在...的实现是...”。我要强调的是前面的限定语 |
|