#include <iostream>
#include <stdlib.h>#include
<windows.h>using namespace
std;class A{
char a;public:
A(){a = 'a';cout<<"is
A construct function"<<endl;}
~A(){cout<<"is A Unconstruct function"<<endl;}
virtual void f(){cout<<"im A v_table"<<endl;}};class A1{
char b;public: A1(){b = 'b';cout<<"is A1
construct function"<<endl;}
~A1(){cout<<"is A1 Unconstruct function"<<endl;}
virtual void f(){cout<<"im A1 v_table"<<endl;}};class
B:public A,public A1{
char c;public:
B(){c = 'c';cout<<"is B construct function"<<endl;}
~B(){cout<<"is B Unconstruct function"<<endl;}
virtual void f1(){cout<<"im
B v_table"<<endl;}};typedef
void (*Fun)(void);int main(){
B b; char *p = (char *)(&b);
cout<<sizeof(b)<<endl;
Fun pFun = NULL;
pFun = (Fun)*((int*)*(int*)(&b));
pFun(); pFun = (Fun)*((int*)*(int*)(&b)+1);
pFun(); pFun = (Fun)*((int*)*(int*)(p+8));
pFun(); for(int i = 0;i<16;i++)
cout<<"i:"<<i<<" "<<(*(p+i))<<endl;
system("pause");
return 1;}