{
public:
virtual void fun1() = 0;
virtual void fun2() = 0;
virtual void fun3() = 0;
};
class B
{
public:
virtual void funB1() = 0;
virtual void funB2() = 0;
virtual void funB3() = 0;
};
class C : public A,public B
{
public:
C()
{
m_pa = reinterpret_cast<A*>(static_cast<B*>(this));
}
virtual void fun1() {m_pa->fun1();}
virtual void fun2() {m_pa->fun2();}
virtual void fun3() {m_pa->fun3();}
virtual void funB1() {printf("funcb1\n");}
virtual void funB2() {printf("funcb2\n");}
virtual void funB3() {printf("funcb3\n");}
A* m_pa;
};
int _tmain(int argc,_TCHAR* argv[])
{
A* pa = new C();
pa->fun1();
delete pa;
return 0;}
//
funcb1.
原文链接:https://www.f2er.com/javaschema/286233.html