C++多重继承问题

#include
#include

using namespace std;
class A{int m_a;};
class B{int m_b;} ;
class C:public A,public B
{
int m_c; 
};

int main(int argc, char *argv[])
{
C *pc=new C;
B *pb=dynamic_cast(pc);
A *pa=dynamic_cast(pc);
cout<cout<cout<cout<<(C*)pb<cout<system("PAUSE");
return EXIT_SUCCESS;
}

转载于:https://www.cnblogs.com/fickleness/archive/2013/04/17/3025951.html

你可能感兴趣的:(C++多重继承问题)