C++继承中的虚析构函数
摘要:
看看下面程序有什么错误:#include <iostream>using namespace std;class Father{public: Father(){}; ~Father(){};};class Son:public Father{public: Son(){}; ~Son(){};};int main(){ Father *pfather=new Son; delete pfather; pfather=NULL; return 0;}该程序在VC++6.0运行后并未发生错误,何解?修改上面程序如下:#include <iostre... 阅读全文
posted @ 2012-03-08 14:32 深圳彦祖 阅读(3453) 评论(0) 推荐(0) 编辑