1)
#define offsetof(s, m) (size_t)&(((s *)0)->m)
2)
#define OBJECT_HEAD_ADDRESS(ClassName,MemberName,Addre) \Addre - offsetof(ClassName, MemberName)
C语言中offsetof宏的应用,布布扣,bubuko.com
C语言中offsetof宏的应用
原文:http://www.cnblogs.com/happy-pm/p/3809813.html