?? p407 虛析構函數.cpp
字號:
#include<iostream>
using namespace std;
class Shape
{
public:
Shape(){}
virtual ~Shape(){ cout<<"the fatherbase distructor "<<endl; }
};
class Point:public Shape
{
public:
Point(){}
~Point(){cout<<"the first-sonbase distructor "<<endl; }
};
class Circle:public Point
{
public:
Circle(){}
~Circle() {cout<<"the second-sonbase distructor "<<endl;}
};
int main()
{
Shape *p=new Point;
delete p;
system("pause");
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -