单选题下面关于模板的描述,错误的是( )。
单选题面向对象方法中,继承是指( )。
单选题有如下程序: #include<iostream> using namespace std; class A public: static int a; void init()a=1; A(int a=2)init(); a++; ; int A::a=0; A obj; int main() cout<<obj.a; return 0; 运行时输出的结果是( )。
单选题有如下类定义:
class B
{
public: void funl(){}
private: void fun2(){}
protected: void fun3(){}
};
class D: public B
{
protected: void fun4(){}
};
若obj是类D的对象,则下列语句中不违反访问控制权限的是______。
单选题有如下程序:
#include<iostream>
#include<iostream>
using namespace std;
int main()
{
cout.fill("*");
cout<<left<<setw(4)<<123<<"OK"<<endl;
return 0;
}
执行这个程序的输出结果是______。
单选题有如下类的定义,横线处的语句是( )。 class TestClass { ________int x,y; public: TestClass(int a=0,int b=0) { X=a: y=b; } static void change() { y-=10; y一=10; } };
单选题下列程序将x,y和z按从小到大的顺序排列,请将下面的函数模板补充完整。 template<class T> void fun(______) T a; if(x>y) a=x; x=y;y=a; if(y>z) a=y; y=z;z=a; if(x>y) a=x; x=y;y=a;
单选题C++中运算符优先级由高到低排列正确的是( )。
单选题下列叙述中,正确的是( )。
单选题有如下头文件:
int f1();
static int f2();
class MA {
public:
int f3();
static int f4();
};
在所描述的函数中,具有隐含的this指针的是______。
单选题有如下程序 #include<iostream.h>
void main( ) {
float x=2.O,y;
if(x<O.0)y=0.0; else
if(x<10.O)y=1.0/x; else y=1.0;
cout<<y; }
该程序的输出结果是
A. 0
B. 0.25
C. 0.5
D. 1.0
单选题下列程序的运行结果是 main( ) int a=2,c=5; cout<<"a="<<a<<"b="<<c<<endl;
单选题有如下程序:
#include<iostream>
using namespace std;
class MyClass{
public:
MyClass() {cout<<'*';)
MyClass(MyClass)
~MyClass() {cout<<'@';)
};
int main();
MyClass a;
Myclass b(A) ;
return 0;
}
运行时的输出结果是( )。
单选题某二叉树共有12个结点,其中叶子结点只有1个。则该二叉树的深度为(根结点在第1层)( )。
单选题下列有关指针的用法中,错误的是( )。 A) int i;int*p= B) int i;int*p;i=*p; C) int*p;p=0; D) int i=5;int*p;p=
单选题带有虚基类的多层派生类构造函数的成员初始化列表中都要列出虚基类的构造函数,这样将对虚基类的子对象初始化______。
A.与虚基类下面的派生类个数有关
B.多次
C.两次
D.一次
单选题下列程序输出的结果是( )。 #include<stdio.h> fun1(char a,char b)char c;c=a;a=b;b=c; fun2(char*a,char b)char c;c=*a;*a=b;b=c; fun3(char*a,char*b)char c;c=*a;*a=*b;*b=c; void main() char a,b; a='A';b='B';fun1(a,b);putchar(
单选题有三个关系R、S和T如下:
R
A
B
C
a
1
2
b
2
1
c
3
1
S
A
D
c
4
T
A
B
C
D
c
3
1
4
则由关系R和S得到关系T的操作是______。
单选题下面程序段的正确输出是 int w=4,x=3,y=2,z=1; cout<<(w<x? w:z<y? z:x)<<end1;
单选题下列关于析构函数的描述中,错误的是( )。