选择题 在一个函数体中,定义一个变量的默认存储类型是______。
选择题 下列关于多继承二义性的描述中,错误的是 。
选择题 关于动态存储分配,下列说法正确的是 。
选择题 下面程序错误的语句是
①# include <iostream.h>
②void main( )
③{
④int * p=new int[1];
⑤p=9;
⑥cout << * p << endl;
⑦delete [ ]p;
⑧}
选择题 有以下类定义:
class Point {
public:
Point(int x=0,int y=0){_x=x; _y=y;}
void Move(int x Off, int y Off)
{_x+=x Off; _y+=y Off; }
void Print() const
{
cout <<'(' << _x << ',' << _y << ')'<< end 1;}
private:
int _x,_y;
}
下列语句中会发生编译错误的是______。
选择题 下面关于对象概念的描述中,错误的是______
选择题 下列不能作为类的成员的是______。
选择题 下面程序的输出结果是______。
#include <iostream>
using namespace std;
int main()
{
int x;
for(int i=1; i<=100; i++){
x=i;
if(++x%2==0)
if(++x%3==0)
if(++x%7==0)
cout<<x<<',';
}
cout<<endl;
}
选择题 下列关于模板的叙述中错误的是______。
选择题 下列关于构造函数说法不正确的是______
选择题 下列叙述中正确的是______
选择题 在一个抽象类中,一定包含有______。
选择题 若MyTemp是一个具有虚拟类型参数的类模板,且
有如下语句序列:
MyTemp<double>p2;
MyTemp<long>p3[2];
编译系统在处理上面的语句序列时,所生成的模板MyTemp的实例的个数是______。
选择题 有以下程序
#include<iostream.h>
void ss(char*s,char t)
{ while(*s)
{ if(*S==t)*s=t-'a'+'A';
s++;} }
void main( )
{ char strl[100]='abcddfefdbd',c='d':
ss(strl,c) ;cout<<strl;}
程序运行后的输出结果是______
选择题 若MyClass为一个类,执行“MyClass a[4], *p[5];”语句时会自动调用该类的构造函数的次数是______。
选择题 已知类IMS中两个成员函数的声明为“void listen()const;”与“void speak();”,另有两个对象的定义为“IMS obj1;”与“const IMS obj2;”,则下列语句中,产生编译错误的是______。
选择题 在下面程序中,编译时出现错误的是 ______。
Class A //(1)
{
public: //(2)
A(){
f(); //(3)
}
void B(){
f();
}
virtual void f()const=0; //(4)
};
选择题 如有以下程序:
#include<iostream>
using namespace std,
long fun(int n)
{
if(n>2)
return(fun(n-1)+fun(n-2));
else
return 2;
}
int main()
{
cout<<fun(3)<<end1;
return 0;
}
则该程序的输出结果应该是______。
选择题 要通过函数实现一种不太复杂的功能,并且要求加快执行速度,则应该选用______
选择题 线性表进行二分法检索,其前提条件是 。