单选题下列关于纯虚函数与抽象类的描述中,错误的是______。
单选题有如下程序: #include<iostream> using namespace std; class MyClass{ public: MyClass(int x):Val(x){} void Set(int x){val=x;} void Print()const{cout<<''val=''<<val<<'\t';} private: int val; }; int main(){ const MyClass obj 1(10); MyClass obj2(20); obj1.Print(); //语句1 obj2.Print(); //语句2 obj1.Set(20);//语句3 obj2.Set(30);//语句4 return 0; } 其主函数中错误的语句是( )。
单选题构成计算机软件的是( )。
单选题软件是指( )。
单选题在数据库系统中,用户所见的数据模式为
单选题对下面的程序,正确的说法是{{U}} {{/U}}。 main()
{ int a,b=1,c=2; a=b+c,a+b,c+3;
c=(c)? a++:b--; cout<< a+b,c;}
A. 无错误
B. 第三行有错误
C. 第四行有错误
D. 第五行有错误
单选题下列程序的执行结果是( )。 #include<iostream.h> #include<stdlib.h> Class TestClass public: int x,y; TestClass()x=y=0; TestClass(int a,int b)x=a;y=b; void disp() cout<<"x="<<x<<",y="<<y<<end1; ; void main() TestClass s1(2,3); s1.disp();
单选题对应于“int a, b; float c; scanf ("a=% d, b=% f c= % d", ”的输入是 ( )。
单选题软件详细设计产生的图如下:该图是
单选题有以下程序;
#include
usingnamespacestd;
classComplex
{
public:
Complex(doubler=0,doublei=O):re(r),im(i){}
doublereal()const{returnre;}
doubleimag()const{returnim;}
Complexoperator+(Complexc)const
{returnComplex(re+C.re,im+C.im);}
private:
doublere,im;
};
intmain()
{
Complexa=Complex(1,1)+Complex(5);
cout< return0;
}
程序执行后的输出结果是( )。
单选题下面叙述错误的是( )。 A) 派生类可以使用private派生 B) 对基类成员的访问必须是无二义性的 C) 基类成员的访问能力在派生类中维持不变 D) 赋值兼容规则也适用于多继承的组合
单选题下列描述中哪个是正确的?
A. 派生类构造函数中没有调用父类构造函数则没有对父类初始化
B. 子类构造函数不能是内联函数
C. 派生类构造函数中可以对父类数据成员赋值
D. 构造函数的返回值为void类型
单选题下列程序的输出结果是
#include<iostream.h>
void main( )
{ double d=3.2;
int x,y;
x=1.2;
y=(x+3.8)/5.0;
cout < < y * d < < end1;}
单选题在C++H冲,打开一个文件时与该文件建立联系的是( )。
单选题有如下类定义: class MyBase{ int k; public: MyBase(int n=0):k(n){} int value()const{return k;} }; class MyDerived:MyBase{ intj; public: MyDerived(int i):j(i){} int getK()const{return k;} int getJ()const{return j;} }; 编译时发现有一处语法错误,对这个错误最准确的描述是( )。
单选题与语句“cout<<endl;”不等价的是______。
单选题有如下程序
#include <iostream>
using namespace std;
class base
{
public:
virtual void f1()
{
cout<<"F1Base";
}
virtual void f2()
{
cout<<"F2Base";
}
};
class derive: public base
{
void f1()
{
cout<<"F1Derive";
}
void f2(intx)
{
cout<<"F2Derive";
}
};
int main()
{
base obj1,*p;
derive obj2;
p=
p->f1();
p->f2();
return 0;
}
执行后的输出结果是
____
。
单选题下列叙述正确的是______。
单选题有如下头文件:int f1();static int f2();class MA{public:int f3();static int f4();};在所描述的函数中,具有隐含的this指针的是( )。
单选题某二叉树共有7个结点,其中叶子结点只有1个,则该二叉树的深度为(假设根结点在第1层)______。