point2.h

来自「用三个类来研究类的继承!类Point、Circle、Cylinder」· C头文件 代码 · 共 20 行

H
20
字号
//point2.h
//类Point的定义

#ifndef point2_h
#define point2_h

class Point{
	friend ostream &operator<< (ostream &output, const Point &);
public:
	Point(float=0, float=0);	//默认构造函数
	void setPoint(float, float);		//设置坐标值
	float getX() const {return x;}	//读取x坐标的值
	float getY() const {return y;}	//读取y坐标的值
protected:	//可被派生类访问
	float x;	
	float y;
};

#endif

⌨️ 快捷键说明

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