‘++’符号重载出现错误

来源:互联网 发布:和氏璧现在在哪里 知乎 编辑:程序博客网 时间:2024/06/05 07:25

代码如下:

   -----point.hclass Point{public:    Point();    Point(float x, float y);    ~Point();        Point operator ++();    Point operator --();private:    float x, y;}      -----point.cppPoint Point::operator ++(){        this->x = this->x + 1;    this->y = this->y + 1;    return *this;}Point Point::operator --(){    this->x = this->x - 1;    this->y = this->y - 1;    return *this;}


0 0
原创粉丝点击