单选题若已定义;
inta[]={0,1,2,3,4,5,6,7,8,9},*p=a,i;
其中0≤i=≤9,则对a数组元素不正确的引用是
____
。
单选题已知类模板Test定义如下:
template <typename T1, typename T2>
class Test{
public:
void foo(T2 t);
};
则以下针对foo函数的类外定义中语法正确的是
单选题下面关于虚函数的描述,错误的是( )。
单选题以下程序执行后的输出结果是 #include<iostream> using namcspace std; void try(int,int,int,int); int main() int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; void try(int x,int y, int z,int r) z = x+y; x = x*x; y = y*y; r = z+x+y;
单选题下列叙述中错误的是( )。
单选题下列各组类型声明符中,含义相同的一组是( )。
单选题p是指向ClassA类型对象的指针。执行deletep;时,系统自动调用
单选题有以下程序: #include<iostream> using namespace std; int n[][3]=10,20,30,40,50,60; int main() int (*p)[3]; p=n; cout<<p[0] [0]<<","<<*(p[0]+1)<<","<<(*p) [2]<<end1; return 0; 上述程序执行后的输出结果是( )。
单选题对长度为n的线性表排序,在最坏情况下,比较次数不是n(n一1)/2的排序方法是( )。
单选题有如下程序:
#include<iostream>
using namespace std;
class AA{
public:
AA(){cout<<"1";}
};
class BB:public AA{
int k;
public:
BB():k(0){ cout<<"2"; }
BB(int n):k(n){ cout<<"3"; }
};
int main(){
BB b(4),c;
return 0;
}
运行时的输出结果是______。
单选题下列叙述中正确的是( )。
单选题有如下程序:
#include
using namespace std;
int main()
{
int*p;
*p=9;
cout<<"The value at p:"<<*p;
return 0;
}
编译运行程序将出现的情况是( )。
单选题若变量都已正确说明,则以下程序段的输出结果是( ) a=2;b=3;printf(a>b?''***a=%d'':''###b=%d''a,b);
单选题有如下的类声明:
#include
using namespace std;
class AA{
public:
virtual void disp(){ cout<<'A'; }
};
class BB: public AA{
public:
void disp(){ cout<<'B'; }
};
class CC: public BB{
public:
virtual void disp(){ cout<<'C'; }
};
void plot(AA a){ a.disp(); }
int main(){
BB bb;
CC cc;
BB
plot(bb);
cc.disp();
rb.disp();
return 0;
}
运行这个程序的输出是
单选题下列程序的输出结果为2,横线处应添加语句( )。
#include
using namespace std;
class TestClass1
{
public:
void fun(){coutfun();
delete p;
return 0:
}
单选题下列关于多继承二义性的描述中,错误的是( )。
单选题在传值调用中,要求( )。
单选题有以下程序: #include <iostream.h> void sort(int L[],int n) int j, k, flag, temp; flag=n-1; while (flag>O) k=flag-1; flag=O; for (j=O; j<=k; j++) if(L[j]>L[j+1]) temp=L[j];L[j]=L[j+1]; L[j+1] =temp; flag=j; void main() int array[4]=2, 1,3,0; sort (array, 4); for (int i=O; i<4; i++) cout <<array[i]; cout <<end; 程序执行后的输出结果是( )。
单选题下面不属于需求分析阶段任务的是( )。
单选题若已经声明了函数"intfun(intx,inty=0);",则下列重载函数声明中,正确的是
