选择题 下面关于对象概念的描述中,错误的是______
选择题 下列不能作为类的成员的是______。
选择题 下面程序的输出结果是______。
#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;
}
则该程序的输出结果应该是______。
选择题 要通过函数实现一种不太复杂的功能,并且要求加快执行速度,则应该选用______
选择题 线性表进行二分法检索,其前提条件是 。
选择题 在C++语言中函数返回值的类型是由______决定的。
选择题 以下程序的输出是 。
struct st
{
int x;int *y;
}
*p;
int dt[4]={10,20,30,40};
struct st aa[4]= {50,dt[0],60,dt[1],70,dt[2],80,dt[3]};
main()
{
p=aa;
cout<<++p->x;
cout<<(++p)->x;
cout<<++(*p->y);
}
选择题 有如下程序:
#include <iostream.h>
#include <iomanip.h>
using namespace std;
class CSum
{
int x,y;
public:
CSum (int x0,int y0):x(x0),y(y0){}
friend ostream operator<<(ostream os,const CSum xa)
{
os<<setw(5)<<xa.x+xa.y;
return os;
}
};
int main ()
{
CSum y(3,5);
cout<<setfill('*')<<8;
cout<<y;
return 0;
}
执行上面程序的输出是______
选择题 在数据管理技术的发展过程中,经历了人工管理阶段、文件系统阶段和数据库系统阶段。
其中数据独立性最高的阶段是______
选择题 在下列枚举符号中,用来表示“相对于当前位置”文件定位方式的是______。
