2014年5月14日

在基类中的析构函数声明为virtual

摘要: 1 #include 2 using namespace std; 3 4 class Father 5 { 6 public: 7 ~Father() 8 { 9 cout 2 using namespace std; 3 4 class Fathe... 阅读全文

posted @ 2014-05-14 11:12 阳台 阅读(629) 评论(0) 推荐(1)

C++中delete 和delete[]的区别

摘要: c++告诉我们在回收new分配的单个对象的内存空间的时候用delete, 回收new[ ]分配的一组对象的内存空间的时候用 delete[ ]; 1 #include 2 using namespace std; 3 4 class Father 5 { 6 public: ... 阅读全文

posted @ 2014-05-14 10:59 阳台 阅读(1002) 评论(0) 推荐(0)

导航