2013年3月12日

多态基类的析构函数应该为虚函数

摘要: #include<iostream>using namespace std;class CBird{public: CBird() { cout << "CBird constructor." << endl; }; ~CBird() { cout << "CBird destructor." << endl; }; virtual void fly() { cout << "CBird fly." << endl; };};class CLark : 阅读全文

posted @ 2013-03-12 09:37 zhuyf87 阅读(4200) 评论(0) 推荐(0) 编辑

导航