#include "stdio.h" class Base { public: virtual void Fun1() { printf("Call Base Fun1\n"); } virtual void Fun2() { printf("Call Base Fun2\n"); } virtual void Fun3() { printf("Call Base Fun3\n"); } private: virtual void Fun4() { printf("Call Base Fun4\n"); } }; class Derived : public Base { public: virtual void Fun1() { printf("Call Derived Fun1\n"); } virtual void Fun5() { printf("Call Fun5\n"); } }; typedef void(*Fun)(void); void main(void) { Derived lDerived; int** lpVtableAdd = (int**)&lDerived; for (int i = 0; i< 5; ++i) { Fun lpFun = (Fun)(lpVtableAdd[0][i]); lpFun(); } printf("First add of Base:%d, and first virtual Fun add:%d\n",(int*)(&lDerived),&lpVtableAdd); }