⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xt12-3-1.cpp

📁 最新版谭浩强《c++语言程序设计》所有习题的原代码
💻 CPP
字号:
#include <iostream>
using namespace std;
class Point
{public:
  Point(float a,float b):x(a),y(b){}
  ~Point(){cout<<"executing Point destructor"<<endl;}
 private:
  float x;
  float y;
};

class Circle:public Point
{public:
Circle(float a,float b,float r):Point(a,b),radius(r){}
  ~Circle(){cout<<"executing Circle destructor"<<endl;}
 private:
  float radus;
};

int main()
{Point *p=new Circle(2.5,1.8,4.5);
 delete p;
 return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -