摘要: #include <cstdlib>#include <iostream>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<B*>(pc);A *pa=dynamic_cast<A*>(pc);cout<<pc<<endl;//0x892a20cout<&l 阅读全文
posted @ 2013-04-17 12:30 夜雨阑珊 阅读(167) 评论(0) 推荐(0) 编辑
摘要: #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<<pc<<endl;//0x892a20cout<<pb<<endl;//0x892a24cout<<pa<<e 阅读全文
posted @ 2013-04-17 12:28 夜雨阑珊 阅读(124) 评论(0) 推荐(0) 编辑