题目内容
下面程序中对一维坐标点类Point进行运算符重载:#includeusing namespace std;class point {public:point (int val) {x=val;}point& operator++(){x++;return*this;}// Apoint operator++(int) {point old=*this;++(*this);return old;} // Bint GetX() const {return x;}private:int x;};int main(){point a(10);cout<<(++a).GetX();// Ccout<
查看答案
搜索结果不匹配?点我反馈