??????????????????????????????????????operator????趨???????????????????????ò????????????????????β??????????????????????this????????????????????????????????ò????????????????????????????

?????????????????????????????????г???????????????????????????

????::       .*          .         ?:

?????????????????????????this????????????

???????????????????????????

??????????????????????

????1????????????

???????????Point??Point.h??????

// Point.h: interface for the Point class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_POINT_H__E8270DD2_C889_4B24_BC82_E154B77FDFCF__INCLUDED_)
#define AFX_POINT_H__E8270DD2_C889_4B24_BC82_E154B77FDFCF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class Point
{
public:
 Point();
 Point(int x??int y);
 virtual ~Point();
 int getX();
 int getY();
 Point operator+(const Point&);
private:
 int x??y;

};

#endif // !defined(AFX_POINT_H__E8270DD2_C889_4B24_BC82_E154B77FDFCF__INCLUDED_)

????Point.cpp??????

// Point.cpp: implementation of the Point class.
//
//////////////////////////////////////////////////////////////////////

#include "Point.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Point::Point()
{

}
Point::Point(int x??int y)
{

 this->x=x;
 this->y=y;
}

Point::~Point()
{

}
Point Point::operator +(const Point &pt)
{
 Point p(*this);
 p.x+=pt.x;
 p.y+=pt.y;

 return p;
}

int Point::getX()
{

 return this->x;
}
int Point::getY()
{
 return this->y;
}