问题详情

( 33 )下面程序中对一维坐标点类 Point 进行运算符重载

#include

using 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 x;

};

int main ()

{

point a ( 10 ) ;

cout$amp;cout$amp;retum () ;

}

编译和运行情况是

A )运行时输出 1011

B )运行时输出 1111

C )运行时输出 1112

D )编译有错

参考答案
您可能感兴趣的试题