单选题若有以下程序:
#include <iostream>
using namespace std;
class Base
{
private:
int a,b;
public:
Base(int x, int y)
{
a=x;
b=y;
}
void show()
{
cout<<a<<", "<<b<<end1;
}
};
class Derive : public Base
{
private:
int c, d;
public:
Derive(int x, int y, int z,int m):Base(x,y)
{
c=z;
d=m;
}
void show()
{
cout<<c<<", "<<d<<end1;
}
};
int main ( )
{
Base b(50,50) ,*pb;
Derive d(10,20,30,40);
pb=
pb->show {);
return 0;
}
单选题数据库的故障恢复一般是由
____
。
单选题有如下定义: int a[5]={1,3,5,7,9},*p=a; 下列表达式中不能得到数值5的是( )。
单选题有如下程序:
#include<iostream>
using nanespace std;
int main()
{
void function(double val);
double val;
function(val);
cout<<val;
return 0;
}
void function(double val)
{
val=3;
}
编译运行这个程序将出现的情况是______。
单选题有如下程序 #include<iostream> #include<iomanip> using namespace std; int main(){ cout<<setprecision(3)<<fixed<<setfill('*')<<setw(8); cout<<12.345<<_______<<34.567; return 0: } 若程序的输出是: **12.345**34.567 则程序中下划线处遗漏的操作符是( )。
单选题在有n个结点的二叉链表中,值为非空的链域的个数为 ______。
单选题下列选项合法的标识符是( )。
单选题对C++编译器区分重载函数无任何意义的信息是( )。
单选题在进行完任何C++流的操作后,都可以用C++流的有关成员函数检测流的状态;其中只能用于检测输入流状态的操作函数名称是( )。
单选题当循环队列非空且队尾指针等于队头指针时,说明循环队列已满,不能进行入队运算。这种情况称为( )。
单选题下列关于派生类构造函数和析构函数的说法中,错误的是______。
单选题C++语言规定,函数返回值的类型是由( )。 A) return语句中的表达式类型所决定 B) 调用该函数时的主调函数类型所决定 C) 调用该函数时系统临时决定 D) 在定义该函数时所指定的函数类型所决定
单选题如下程序的输出结果是 #include<iostream> #include<cstring> using namespace std; class XCF{ int a; public: XCF(int aa=0):a(aA) {cout<<"1";} XCF(XCFX){a=x.a;cout<<"2";l ~XCF( ){cout<<a;} int Geta( )t return a;} }; int main( ){ XCF d(15),d2(d1); XCF*pd=new XCF(8); cout<<pd->Geta( ); delete pd; return 0; }
单选题要求加快执行速度,而且函数完成的功能不太复杂时,应使用( )。
单选题下列关于运算符重载的描述中, ______ 是正确的。
A. 运算符重载可以改变操作数的个数
B. 运算符重载可以改变优先级
C. 运算符重载可以改变结合性
D. 运算符重载不可以改变语法结构
单选题有如下程序: #include<iostream> #include<string> using namespace std; class MyBag public: MyBag(string br,string cr):brand( br), color(cr)++count; ~MyBag()--count; static int GetCount() return count; pnvate: string brand,color; static int count; ; int main() MyBag one("CityLife","Gray"),two("Micky","Red"); cout<<MyBag::CetCount(); return 0; 若程序运行时的输出结果为2,则横线处缺失的语句是______。 A.int count=0; B.static int count=0; C.int MyBag::count=0; D.static int MyBag::count=0;
单选题有下列程序:
#include <stdio.h>
void fun(int*a,int*b)
{ int*c;
c=a;a=b;b=c;
}
void main()
{ int x=3,y=5,*p=&,*q=&y;
fun(p,q);printf("%d,%d,",*p,*q);
fun(&x,&y);printf("%d,%d/n",*p,*q)
}
程序运行后的输出结果是______。
单选题有如下程序 #include<iostream> #include<iomanip> using namespace std; class MyClass{ public: MyClass(){cout<<'A';} MyClass(chaf c){cout<<c;} ~MyClass(){cout<<'B';} }; int main(){ MyClass p1,*p2; p2=new MyClass('X'); delete p2; return 0; } 执行这个程序屏幕上将显示输出( )。
单选题己知类X是类Y的友元,类Y是类Z的友元,则 ______。
单选题下列选项中合法的用户标识符是
____
。