单选题下列程序执行后,屏幕的输出是( )。 #include<iostream> using namespace std; void swap(int x,int y) int temp=x; x=y; y=temp; cout<<"x="<<x<<"",y=""<<y<<end1; int main() int x=3,y=2; swap(x,y); cout<<"x="<<x<<",y="<<y<<end1; return 0; A) x=3,y=2 x=3,y=2 B) x=2,y=3 x=3,y=2 C) x=2,y=3 x=2,y=3 D) x=3,y=2 x=2,y=3
单选题下面程序段的正确输出是______。
int w=4,x=3,y=2,z=1; cout<<(w<x?w:z<y?z:x)<<endl;
单选题下列关于多继承二义性的描述中,错误的是
____
。
单选题以下不使用线性结构表示实体之间联系的模型的是
____
。
单选题当使用fstream流类定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式为
____
。
单选题有如下类定义:
class Sample{
public;
Sample(int x):ref(x){} //①
private:
Sample():ref(0){} //②
static int val=5; //③
constint ref; //④
};
上述程序段中,错误的语句是______。
单选题如果表达式y*x++中,“*”是作为成员函数重载的运算符,“++”是作为友元函数重载的运算符,采用运算符函数调用格式时,该表达式应表示为______。
单选题下列程序执行结果是______。
#include<iostream.h>
class A
{ public;
int a;
A():a(10){cout<<a<<end1;}
};
void main()
{ A obj1;
A obj2(obj1);
cout<<" "<<obj2.a<<end1;
}
单选题要利用C++流实现输入输出的各种格式控制,必须在程序中包含的头文件是( )。
单选题已知类CC以成员函数方式重载了二元运算符*,c1和c2是CC类的两个对象,则下列对该运算符的调用中错误的是______。
单选题某系统总体结构图如下图所示:该系统总体结构图的深度是()。
单选题下面程序的结果为 #include<iostream.h> int c; class A private: int a; static int b; public: A( ) a=0;c=0; void seta( )a++; void setb( )b++; void setc( )c++; void display( ) cout << a << " " << b << " " << C; ; int A: :b=0; void main( ) A a1,a2; a1.seta( ); a1.setb( ); a1.setc( ); a2.seta( ); a2.setb( ); a2.setc( ); a2.display( );
单选题以下程序的执行结果是( )。 #include<iostream.h> int fun(int b[],int n) int i,r=1; for(i=0;i<n;i++) r=r*b[i]; void main() int x,a[]=1,2,3,4,5,6,7,8; x=fun(a,3); cout<<x<<endl;
单选题下面数据结构中,属于非线性的是{{U}} {{/U}}。
A. 线性表
B. 队列
C. 树
D. 栈
单选题下列程序段中包含4个函数,其中具有隐含this指针的是
____
。
int funl();
class Test{
public:
int fun2();
friend int fun3();
static int fun4();
};
单选题下列有关类成员的叙述中,正确的是______。
单选题在公有继承的情况下,允许派生类直接访问的基类成员包括( )。
单选题关于构造函数A()的拷贝构造函数正确的是
单选题有如下程序: #include<iostream> using namespace std; int main(){ hat sum; for(int i=0;i<6;i+=3){ sum=i; for(int j=i;j<6;j++)sum+=j; } cout<<sum<<end 1; return 0: } 运行时的输出结果是( )。
单选题下面关于虚函数的描述,错误的是( )。
