单选题有如下程序: #include<iostream> using namespace std; class Base{ public: Base(int x=0):valB(x){cout<<valB;} ~Base(){cout<<valB;} private: int valB; }; class Derived:public Base{ public: Derived(int x=0,int y=0):Base(x),valD(y){cout<<valD;} ~Derived(){cout<<valD;} private: int valD; }; int main(){ Derived obj 12(2,3); return 0; } 运行时的输出结果是( )。
单选题若已知char str[20];,有语句cin>>str; 当输入为; This is a program 所得的结果是str=( )。
单选题下列叙述中正确的是
单选题首先访问该结点,然后访问结点的左子树,最后访问结点的右子树,这种遍历方式称为( )。
单选题下列关于赋值运算符“=”重载的叙述中,正确的是
A. 赋值运算符只能作为类的成员函数重载
B. 默认的赋值运算符实现了“深层复制”功能
C. 重载的赋值运算符函数有两个本类对象作为形参
D. 如果己经定义了复制(拷贝)构造函数,就不能重载赋值运算符
单选题有如下程序: #include <iostream> using namespace std; class BASE{ public: ~BASE(){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED(){cout<<"DERIVED";} }; int main(){DERIVED x;return 0;} 执行后的输出结果是
单选题对于复制构造函数和赋值操作的关系,正确的是( )。
单选题下列有关抽象类和纯虚函数的叙述中,错误的是( )。
单选题在面向对象方法中,实现信息隐蔽是依靠( )。
单选题数据库设计中反映用户对数据要求的模式是______。
单选题需求分析阶段的任务是确定______。
单选题有以下程序: #include <iostream> using namespace std; class sample private: int x; public: void setx(int i) x=i; int putx () return x; ; int main ( ) sample *p; sample A[3]; A[0] .setx(5); A[1] .setx (6); A[2] .setx(7); for (int j=0;j<3;j++) p= cout<<p->putx () <<", "; cout<<end1; return 0; 执行后执行结果是( )。
单选题在C++中既可以用于文件输入又可以用于文件输出的流类是______。
单选题软件设计中划分模块的一个准则是______。
单选题设一棵满二叉树共有15个结点,则在该满二叉树中的叶子结点数为( )。 A) 7 B) 8 C) 9 D) 10
单选题下列叙述中正确的是( )。
单选题为了使模块尽可能独立,要求( )。
单选题下面是类Shape的定义: class Shape public: virtual void Draw()=0; 下列关于Shape类的描述中,正确的是( )。
单选题执行语句:{cout<<setfill('*')<<setw(10)<<setfill('#')<<left<<l23<<"OK"<<end1; retum 0;}后将输出( )。
单选题以下程序的运行结果是______。 #include<iostream> using namespace std; const double PI=3.14: class Point int x,y; public: Point(int a,int b)x=a;y=b; int getx()return。; int gety()return y; ; class Circle:public Point int r, public: Circle(int a,int b,int c):Point(a,b) r= c; int getr( )return r; double area( )return PI*r*r; ; int main( ) Circle c1(5 ,7 ,10); cout<<c1.area()<<endl; return 0, A) 25 B) 49 C) 100 D) 314
