问题
单项选择题
有如下类定义:
class Pointint 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次
答案
参考答案:C
有如下类定义:
class Pointint 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次
参考答案:C