I need to compute the offset of a data member at compile time. The class has virtual functions, and so the offsetof macro does not work (why?). Is there a way to do this? My example (compiler error on the printf line): #include <stdio.h> #include <stddef.h> class Foo { public: virtual void Bar(); int m_x; char m_y; char z[30]; float w; }; int main(int argc, char **argv) { printf("%d\n", offsetof(Foo, w)); } Thanks, j -- John Gateley <gateley@xxxxxxxxxx>