单项选择题

有如下类定义:
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次
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序: #include <iostream> using namespace std; class Pair int m,n; public: Pair(int j,int k):m(j),n(k) int get() return m; int get() const return m+n; ; int main() Pair a(3,5); const Pair b(3,5); cout<<a.get()<<b.get(); return 0; 运行时的输出结果是( )。
A.33
B.38
C.83
D.88
单项选择题
有如下程序: #include <iostream> using namespace std; class Music public: void setTitle(char* str) strcpy(title,str); protected: char type[10]; private: char title[20]; ; class Jazz:public Music public: void set(char* str) strcpy(type, Jazz ); ① strcpy(title,str); ② ; 下列叙述中正确的是( )。
A.程序编译正确
B.程序编译时语句①出错
C.程序编译时语句②出错
D.程序编译时语句①和②都出错
相关试题
  • 如果类中的一个成员函数的定义实现在类内,...
  • 下列程序的输出结果是______。 #in...
  • 在下面程序的横线处填上适当的内容,使程序...
  • 请在横线处填写派生类Derived的继承方式,...
  • 写出下列程序的运行结果______。 #...