1个回答
展开全部
Class CPoint{
public:
CPoint(double x=0.0,double y=0.0)
{ m_x=x; m_y=y; }
~CPoint()
{}
double getX() const
{ return m_x; }
void setX(doubel x)
{ m_x=x; }
double getY() const
{ return m_y; }
void setY(doubel y)
{ m_y=y; }
CPoint operator+(const CPoint &p)
{ return CPoint(m_x+p.m_x,m_y+p.m_y); }
void operator++()
{ ++m_x;++m_y; }
void operator++(int)
{ m_x++;m_y++; }
private:
double m_x;
double m_y;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询