单选题如下程序的输出结果是 #include<iostream> using namespaee std; int main( ) eout.fill('*'); eout.width(6); cout.fill('#'): eout<(123<endl: return 0;
单选题有如下程序: #includc<iostream> using namespace std; class VAC{ public: int f()const{return 3;} int f(){return 5;} }; int main(){ VAC v1; const VAC v2; cout<<v1.f()<<v2.f(); return 0; } 运行时的输出结果是
单选题有如下类定义: class Base1{ int m; public: Base(int m1): m(m1){} }; class Base2{ int n; public: Base(int n1): n(n1){} }; class Derived: public Base2,public Base1{ int q; public: Derived(int m1, int n1, int q1): q(q1),Base1(m1),Base2(n1){}; };在创建一个Derived对象时,数据成员m、n和q被初始化的顺序是
单选题有以下程序,输出结果( )。
#include
void main()
{static int b[][3]={{1,2,3},{4},{5,6}};
b[0][2]=12,b[1][2]=18;
cout<<**b<<"\t"<<**(b+1)
<<"\t"<<**(b+1)<<"\t"<<*(*(b+1)+2)<<"\n";
cout<
单选题下列符号中能够作为C++标识符的是______。
A.const
B.2a
C._shape
D.-count
单选题有如下程序:
#include<iostream>
using namespace std;
class Point {
public:
static int number;
public:
Point() {number++;}
~Point() {number --;}
};
int Point::number=0;
int main() {
Point *ptr;
Point A, B;
{
Point *ptr_point=new Point[3];
ptr=ptr_point;
}
Point C;
cout<<Point::number<<endl;
delete[]ptr;
return 0;
}
执行这个程序的输出结果是______。
单选题下列关于运算符重载的叙述中,错误的是( )。
单选题下列运算符中不能在C++中重载的是( )。
单选题假定int类型变量占用两个字节,其有定义int x[10]={0, 2, 4};,则数组x在内存中所占是______。
单选题程序调试的任务是______。
单选题若有以下程序: #include <iostream> using namespace std; void sub(int x,int y, int *z) *z = y+x; int main() int a,b, c; sub (8,4,&
单选题有如下类声明: class XA{ int x; public: XA(int n){x=n;} }; class XB:public XA{ int y; public: XB(int a,int b); }; 在构造函数XB的下列定义中,正确的是( )。
单选题软件详细设计产生的图如下:该图是______。
单选题关于运算符重载,下列表述中正确的是( )。
单选题下列对重载函数的描述中,( )是错误的。 A) 重载函数中不允许使用默认参数 B) 重载函数中编译是根据参数表进行选择 C) 不要使用重载函数来描述毫不相干的函数 D) 构造函数重载将会给初始化带来多种方式
单选题有如下程序: class Base public: int data; ; class Derived1:public Base; class Derived2:protected Base; int main() Derived1 d1; Derived2 d2; d1.data=0;//① d2.data=0;//② return 0; 下列关于程序编译结果的描述中,正确的是______。 A.①②皆无编译错误 B.①有编译错误,②无编译错误 C.①无编译错误,②有编译错误 D.①②皆有编译错误
单选题已知有定义
constintD=5;
inti=1;
doublef=0.32;
charc=15;
则下列选项错误的是( )。
单选题有以下程序
main()
{ union
{ char ch[2];
int d;
}s;
s.d=0x4321;
printf("%x,%x\n",s.ch[0],s.ch[1]);
}
在16位编译系统上,程序执行后的输出结果是______。
单选题C++语言中,表示一条语句结束的标号是A)#B);C)//D)
单选题在一个派生类的成员函数中,试图调用其基类的成员函数“void f();”,但无法通过编译。这说明( )。