单项选择题
有如下类定义:
class Point
int x_,y_;
public:
Point( ):x_(0),y_(0)
Point(int x,int y=0):x_(x),y_(y)
;
若执行语句:
Point a(2),b[3],*c[4];
则Point类的构造函数被调用的次数是
A.2次
B.3次
C.4次
D.5次
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下类定义: class AA int a; public: int getRef( )eonstreturn &a; ① int getValue( )constreturn a; ② vold set(int n)eonsta=n; ③ friend void show(AA a
A.eonsttout<<a; //④
;
其中的4个函数定义中正确的是A) ①
B.②
C.③
D.④
点击查看答案&解析
单项选择题
有如下程序: int x=3: d0 x-=2: cout<<x: while(!(--x)); 执行这个程序的输出结果是
A.1
B.30
C.12
D.死循环
点击查看答案&解析
相关试题
已知一个函数模板定义为 template <type...
下面是复数类complex的定义,其中重载的运...
有如下程序: #include <iostream> u...
若以非成员函数形式,为类Bounce重载“!”...
有如下程序: #include <iostream> u...