C++??????????
???????????? ???????[ 2012/11/20 9:56:46 ] ????????
??????????????????????????????????????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;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11