一般这种错误都是由于你写的头文件缺少";"导致的

例如你写了

#ifndef MOVE_H_
#define MOVE_H_
using namespace std;
//为了方便,我就直接把实现代码写到头文件了
class Move{	
private:
	double x;
	double y;
public:
	Move(double a=0,double b=0):x(a),y(b){};
	void showmove()const{
		cout<<"x="<<x<<"  y="<<y<<endl;
	};
	Move add(const Move &m)const
	{
		double x1=x+m.x;
		double y1=y+m.y;
		return Move(x1,y1);
	}
	void reset(double a=0,double b=0){
		x=a;
		y=b;
	}


	


};//这里的";你写了没有呢?"



#endif

或者是其他的地方,少了";",认真检查一下就行了

相关文章:

  • 2021-08-08
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-03-07
  • 2022-12-23
相关资源
相似解决方案