++’符号重载出现错误

来源:互联网 发布:淘宝运营流程图 编辑:程序博客网 时间:2024/06/05 10:32

代码如下:

    -----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;}


1 0
原创粉丝点击