单项选择题
有如下类定义: 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 Foo { public: Foo(int v):value(v){} ① ~Foo(){} ② private: Foo(){} ③ int value=0; ④ }; 其中存在语法错误的行是
A.①
B.②
C.③
D.④
点击查看答案&解析
单项选择题
若磁盘上已存在某个文本文件,其全路径文件名为d: ncre test.txt,下列语句中不能打开该文件的是
A.ifstream file("d:\ncre\testxt");
B.ifstream file("d:\\ncre\\testxt");
C.ifstream file;filopen("d:\\ncre\\testxt");
D.ifstream* pFile=new ifstream("d:\\ncre\\testxt");
点击查看答案&解析
相关试题
有如下类定义: class AA { int a;...
有如下程序: #include<iostream> usi...
有如下程序: #include<iostream> usi...
有如下程序: #include<iostream> usi...
有如下程序: #include<iostream> usi...