问题

( 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 )编译有错

参考答案
您可能感兴趣的试题
  • ( 34 )有如下程序:#includeusing namespace std;int main (){char str[100],*p;cout$amp;cin$amp;>amp;$gt;str;p
  • ( 35 )有如下程序::#includeusing namespace std:class Sample{friend long fun ( Sample s ) ;public:Sample (
  • ( 1 ) 在深度为 7 的满二叉树中,度为 2 的结点个数为 【 1 】 。
  • ( 2 ) 软件测试分为白箱(盒)测试和黑箱(盒)测试,等价类划分法属于 【 2 】 测试。
  • ( 3 ) 在数据库系统中,实现各种数据管理功能的核心软件称为 【 3 】 。
  • ( 4 ) 软件生命周期可分为多个阶段,一般分为定义阶段、开发阶段和维护阶段。编码和测试属于 【 4 】阶段。
相关内容