Hello,
Consider the following macro to get the
memory offset of a class data member:
#define OFFSET(CLASSNAM E, MEMBER) ((int) (&((CLASSNAME *) 0)->MEMBER))
Given that 0 may not be the address of
an instance of CLASSNAME, will this
code be legal in standard C++?
Thanks,
JG
Consider the following macro to get the
memory offset of a class data member:
#define OFFSET(CLASSNAM E, MEMBER) ((int) (&((CLASSNAME *) 0)->MEMBER))
Given that 0 may not be the address of
an instance of CLASSNAME, will this
code be legal in standard C++?
Thanks,
JG
Comment