#include <iostream>
using namespace std;
class A {
public:
virtual void aa1() {}
virtual void aa2() {}
};
class B : public virtual A
{
public:
virtual void bb() {}
};
class C : public virtual A
{
public:
virtual void cc() {}
};
class D : public B, public C
{
public:
virtual void dd1() {}
virtual void dd2() {}
};
int main()
{
printf("0x%08x\n",&D::aa1);
printf("0x%08x\n",&D::aa2);
printf("0x%08x\n",&D::bb);
printf("0x%08x\n",&D::cc);
printf("0x%08x\n",&D::dd1);
printf("0x%08x\n",&D::dd2);
return 0;
}
结果:
0x00401014
0x00401019
0x00401014
0x00401014
0x00401019
0x0040101e
怎么不同的函数有相同的地址?
|