#ifndef _POINT_H
#define _PIONT_H
class Point {//类的定义
public://外部接口
Piont();
Piont(int x, int y);
~Piont();
void move(int newX, int newY);
int getX() const { return x; }
int getY() const { return y; }
static void showCount();//静态数据成员
private:
int x, y;
#endif //_PIONT_H
#ifndef _POINT_H
#define _PIONT_H
#endif 这个有什么用能去掉吗
不能去掉,目的就是防止重复引用头文件
一楼解释的不对,多个头文件在一个cpp文件里展开,如果没有这个预定义,类重复定义,编译有错误
这是在防止这个头文件被重复引用,不能去掉