摘要: #include using namespace std; class A{ public: A() { coutA::disp(); //用A:: or X:: 调用指定版本的虚函数 delete b; return 0; } 阅读全文
posted @ 2017-10-20 15:49 hertz0725 阅读(196) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; class A{ public: A() { cout<<"construct A"<<endl; } A(int a) { cout<<"construct int A"<<endl; } virtual ~A() //析构函数 必须 声明为 虚函数,才能彻底释放内存空间 { cout<<"de... 阅读全文
posted @ 2017-10-20 11:54 hertz0725 阅读(192) 评论(0) 推荐(0) 编辑