全部知识点
第6061题
有如下程序,运行此程序输出符号?的个数是()。
#include<iostream>
using namespace std;
class Name{
char name[20];
public:
Name(){
strcpy(name, "?"); cout<<"?";
}
Name(char *fname){
strcpy(name,fname); cout<<"?";
}
};
int main(){
Name name[3]={Name("张三"),Name("李四")};
return 0;
}
第6062题
有如下程序,运行这个程序的输出结果是()。
#include<iostream>
using namespace std;
class Test{
public:
Test(){}
Test(const Test& t){cout<<1;}
};
Test fun(Test &u){Test t=u;return t;}
int main(){Test x,y;x=fun(y);return 0;}
第6063题
若MyClass为一个类,执行 MyClass a[4],*p[5]; 语句时会自动调用该类构造函数的次数是()。
第6064题
有如下程序,运行时的输出结果是()。-
#include<iostream>
using namespace std;
class CD{
public:
~CD() { cout<<"C";}
private:
char name[80];
};
int main(){ CD a, *b, d[2];return 0;}
第6065题
有如下程序,运行时的输出结果是()。
#include<iostream>
using namespace std;
class XA{
int a;
public:
static int b;
XA(int aa):a(aa){b++;}
~XA(){}
int get(){return a;}
};
int XA::b=0;
int main(){
XA d1(2),d2(3);
cout<<<d1.get()+d2.get()+XA::b<<endl;
return 0;
}
第6066题
下列关于析构函数的描述中,错误的是()。
第6067题
下列关于构造函数的描述中,错误的是()。
第6068题
若PAT是一个类,则程序运行时,语句 PAT (*ad)[3]; 调用PAT的构造函数的次数是()。
第6069题
有如下程序,运行时的输出结果是()。
#include<iostream>
using namespace std;
class MyClass {
public:
MyClass () { cout << "*"; }
MyClass (MyClass & a) { cout << "#"; }
~MyClass () { cout << "@"; }
};
int main(){
MyClass a;
Myclass b(a);
return 0;
}
第6070题
有如下程序,运行这个程序的输出结果是()。
#include<iostream>
using namespace std;
class Monkey{
public:
Monkey() {cout<<"M";}
Monkey(char n) {cout<<n;}
~Monkey() {cout<<"Y";}
};
int main(){
Monkey p1,*p2;
p2=new Monkey('X');
delete p2;
return 0;
}
第6071题
下列关于类成员对象构造函数调用顺序的叙述中,正确的是()。
第6072题
有如下程序,运行这个程序的输出结果是()。
#include<iostream>
#include<cstring>
using namespace std;
class MyString{
public:
char str[80];
MyString(const char* s){strcpy(str,s);}
MyString& operator+=(MyString a){
strcat(str,a.str);
return *this;
}
};
ostream& operator<<(ostream& s,const MyString& z){return s<<z.str;}
int main(){
MyString x("abc"),y("cde");
cout<<(x+=y)<<endl;
return 0;
}
第6073题
有如下头文件,在所描述的函数中,具有隐含的this指针的是()。
int f1();
static int f2();
class MA{
public:
int f3();
static int f4();
};
第6074题
有两个关系R和S,则由关系R得到关系S的操作是
关系 R:
| A | B | C |
| a | 1 | 2 |
| b | 2 | 1 |
| c | 3 | 1 |
关系 S:
| A | B | C |
| c | 3 | 1 |
第6075题
数据字典(DD)所定义的对象包含于
第6076题
软件需求规格说明书的作用不包括
第6077题
下列属于黑盒测试方法的是
第6078题
下列不属于软件设计阶段任务的是
第6079题
下列关于函数重载的叙述中,错误的是
第6080题
下列关于类成员对象构造函数调用顺序的叙述中,正确的是