#include <stdio.h>
#include <stdio.h>
#include <iostream>
using namespace std;
class Base
{
public:
virtual void f(){cout <<"Base:f"<<endl;}
virtual void g(){cout<<"Base:g"<<endl;}
virtual void h(){cout<<"Base :h" <<endl;}
};
typedef void(*Fun)(void);
int main()
{
Base b;
Fun pFun = NULL;
cout<< "虚函数表地址" << (int*)(&b)<<endl;
cout<<"虚函数第一个函数的地址" << (int*)*(int*)(&b)<<endl;
pFun = (Fun)*((int*)*(int*)(&b)+1) ;//调用第二个函数 g 看到括号里 指针偏移+1了
pFun();
cin.get();
}