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

📄 fig5_7.cpp

📁 用三个类来研究类的继承!类Point、Circle、Cylinder
💻 CPP
字号:
//fig5_7.cpp
//类Point的测试程序

#include <iostream.h>
#include <assert.h>
#include "point2.h"

main()
{
	Point p(7.2, 11.5);	//建立类Point的对象实例

	//main函数不能访问类Point的受保护数据成员
	cout<<"X coodinate is "<<p.getX()
		<<"\nY coodinate is "<<p.getY()<<endl;

	p.setPoint(10, 10);
	cout<<"\nThe new location of p is "<<p<<endl;

	return 0;
}

⌨️ 快捷键说明

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