C语言中offsetof宏的应用

1)

#define offsetof(s, m)   (size_t)&(((s *)0)->m)

 

2)

#define OBJECT_HEAD_ADDRESS(ClassName,MemberName,Addre) \
Addre - offsetof(ClassName, MemberName)

posted @ 2014-06-26 12:25  HAPPY_PM  阅读(712)  评论(0编辑  收藏  举报