摘要: 析构函数能是纯虚函数吗?答案是肯定的#include <iostream>using namespace std;class A{public: virtual ~A() = NULL;};A::~A() {} //加入该行代码class B : public A{public: virtual ~B() { cout << "B::~B" << endl; }};int main(){ A * p = new B; delete p; B b; return 0;} 一切变得不一样了……但实话实说,这样做的意义不大 阅读全文
posted @ 2012-03-21 10:26 木愚 阅读(334) 评论(0) 推荐(0) 编辑