下面程序中对一维坐标点类Point进行运算符重载 #include <iostream> using namespace std; class Point { public: Point(int val) {x=val;} Point & operator++() {x++; return *this; } Point operator++(int) {Point ld = *this; ++(*this); return old;} int GetX() const {return x;} private: int x; }; int main() { Point a(10); cout << (++a).GetX(); cout << a++.GetX(); return 0; }编译和运行情况是
A.运行时输出1011
B.运行时输出1111
C.运行时输出1112
D.编译有错
[单选题]( 33 )下面程序中对一维坐标点类 Point 进行运算符重载#includeusing namespace std;class point {public:point ( int vaI ) {x=val;}point & operator++ () {x++;retum*this;}print operator++ ( int ) {point ld=*this,++ ( *this ) ;retum old;}int GetX () const {retum x;}private:int
[单选题]下面程序中对一维坐标点类Point进行运算符重载编译和运行情况是( )。A.运行时输出1011B.运行时输出1111C.运行时输出1112D.编译有
[单选题]在重载运算符函数时,下面( )。运算符必须重载为类成员函数形式。A.+B.-C.++D.->
[单选题]在重载运算符函数时,下面运算符必须重载为类的成员函数的是( )。A.+B.-C.++D.->
[试题]在类中重载operator new运算符?
[单选题]为类Matrix重载下列运算符时,只能作为Matrix类成员函数重载的运算符是( )。A.) +B.) =C.) <<D.) ++
[单选题]为类Matrix重载下列运算符时,只能作为Matrix类成员函数重载的运算符是( )。A.+B.=C.<
[单选题]下列运算符中,*运算符在C++中不能重载( )。A.?B.+C.-D.<=
[单选题]下列运算符中,( )运算符在C++中不能重载。A.&&B.[]C.::D.new
[单选题]下列运算符中,( )运算符在C++中不能重载。A.&&B.[]C.::D.new