//////////////////////////////////////////////////////////////////////////Point.h
#include
#include
using namespace std;
class Point
{
private:
double x,y;
public:
Point();
Point(double x,double y);
Point(Point &p);
bool operator == (Point &p);
bool operator != (Point &p);
Point operator += (Point &p);
Point operator -= (Point &p);
Point operator + (Point &p);
Point operator - (Point &p);
friend inline ostream & operator y -= p.y;
return *this;
}
Point Point::operator + (Point &p)
{
Point t;
t.x = this->x + p.x;
t.y = this->y + p.y;
return t;
}
Point Point::operator - (Point &p)
{
Point t;
t.x = this->x - p.x;
t.y = this->y - p.y;
return t;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////main.cpp
#include "Point.h"
int main()
{
Point p1;
Point p2(2.43,5.33);
Point p3(p2);
cout