全部题库 / C++ / 试题详情
单选题 C++
2008-03-20

下面程序中对一维坐标点类Point进行运算符重载  
#include 
using namespace std;  
class point {  
public:  
point (int vaI) {x=val;}  
point& operator++(){x++;retum*this;}  
print operator++(int) {point old=*this,++(*this);retum old;}  
int GetX() const {retum x;}  
private:  
int x;  
};  
int main()  
{  
point a(10);  
cout <<(++A..GetX(); 
cout < retum(); 
}  
编译和运行情况是(  )。

A.运行时输出1011  
B.运行时输出1111  
C.运行时输出1112  
D.编译有错

参考答案

B

答案解析

暂无解析

你可能感兴趣的试题