单选题下面描述错误的是( )。
单选题有如下程序: #include<iostrearn> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<endl; return 0; } 执行后的输出结果是( )。
单选题如果进栈序列为el、e2、e3、e4,则可能的出栈序列是______。
单选题有如下程序:
#include<iostream>
using namespace std;
class Point{
int x,y;
public:
Point(int x1=0,int y1=0):x(x1),y(y1){}
int get(){return x+y;)
};
class Circle{
Point cente;
int radius;
public:
Circle(int cx,int cy,int r):center(cx,cy),radius(r){}
int get(){return center.get()+radius;}
};
int main(){
Circle c(3,4,5);
cout<<c.get()<<endl;
return 0;
}
运行时的输出结果是______。
单选题下面是一个模板声明的开始部分: template<typename T>double… 由此可知______。 A.这可能是一个函数模板的声明 B.这可能是一个类模板的声明 C.这既可能是一个函数模板的声明,也可能是一个类模板的声明 D.这肯定是一个错误的模板声明
单选题己知类MyClock中未显式定义构造函数,并重载了加法运算符,使得下面的语句序列能够正确执行:
MyClock c1,c2;
//......
c2=c1+10;
由此可知:为类MyClock重载的“+”运算符函数的声明是______。
单选题有下列程序: #include <stdio.h>
void main() { int
a=1,b=2,c=3,d=0; if(a==1&&b++==2)
if(b!=2||c--!=3)
printf("%d,%d,%d/n",a,b,c); else
prinif("%d,%d,%d/n",a,b,c); else
printf("%d,%d,%d/n",a,b,c); }
程序运行后的输出结果是______。
A.1,2,3
B.1,3,2
C.1,3,3
D.3,2,1
单选题若x和y是程序中的两个整型变量,则下列if语句中正确的是______。
A.if(x==0)y=1;else y=2;
B.if(x==0)then y=1 else y=2
C.if(x==0)y=1 else y=2;
D.if x==0 y=1 else y=2;
单选题若MyClass是一个类名,其有如下语句序列: MyClass c1,*c2; MyClass *c3=new MyClass; MyClass &c4=c1: 上面的语句序列所定义的类对象的个数是( )。
单选题将E-R图转换到关系模式时,实体与联系都可以表示成
单选题对于下面定义的类MyClass,在函数f()中将对象成员n的值修改为50的语句应该是
class MyClass
{
public:
MyClass(int x) {n=x;}
void SetNum(int nl) {n=nl;}
private:
int n;
}
int f()
{
MyClass *ptr=new MyClass(45);
______
}
单选题在C++中用来实现运行时多态性的是【 】
单选题有如下程序:
#include
using namespace std;
class Point {
public:
static int number;
public:
Point() { number++; }
~Point() { number--; }
};
int Point::number=0;
int main() {
Point *ptr;
Point A, B;
{
Point* ptr_point=new Point[3];
ptr=ptr_point;
}
Point C;
cout<
单选题设有以下语句 int a=1,b=2,c; c=a∧(b<<2);执行后,c的值为______。
单选题如果一个类至少有一个纯虚函数,那么就称该类为{{U}} {{/U}}。
A. 抽象类
B. 虚基类
C. 派生类
D. 以上三者都不对
单选题数据库的数据模型所描述的内容有三个部分,它们是( )。
单选题下面程序的执行结果是 #include"iostream.h" void main() {int*p,r; p=new int; *p=20; r=sizeof(*p); cout<<r<<endl; delete p; }
单选题下面关于C++语言变量的叙述错误的是A)C++语言中变量分为auto,static,extem和register四种存储类型B)自动变量和外部变量的作用域为整个程序C)内部静态变量的作用域是定义它的函数D)外部静态变量的作用域是定义它的文件
单选题有如下程序:
#include<iostream>
using namespace std;
class Part {
public:
Part(int x=0): val(x) {cout<<val;}
~Part() {cout<<val;}
private:
int val;
};
class Whole {
public:
whole(int x, int y, int z=0): p2(x), p1(y), val(z) {cout<<Val;}
~Whole() {cout<<val;}
private:
Part p1, p2;
int val;
};
int main()
{
Whole obj(1, 2, 3);
return 0;
}
执行这个程序的输出结果是______。
单选题设二叉树如下:则前序序列为