填空题 【6】 是C++语言程序的入口。
填空题下列程序运行后的输出结果是 【15】 。 #include<iostream.h> void fun(int,int,int *); void main() int x,y,z; fun(5,6, fun(7,x, fun(x,y, cout<<x<<","<<y<<","<<z<<endl; void fun(int a,int b,int *c) b+=a; *c=b-a;
填空题下面程序输出的结果是{{U}} 【11】 {{/U}}。
#include <iostream>
using namespacc std;
class A {
public:
void show(){tout<<"A!";}
};
class B: public A{
public:
virtual void show(){cout<<"B!";}
};
class C: public B{
public:
virtual void show(){cout<<"C!";}
};
void show_info(A *i){i->show();}
void main(){
A ia;B ib;C ic;show_info( show_info(show_info(
}
填空题当输入d的值22时,以下程序的输出结果是{{U}} {{U}} {{/U}} {{/U}}。
void bin (int b) {
if (b>= 2) bin(b/2);
cout<<b%2;
}
void main() {
int d;
cin>>d;
bin(D) ;
}
填空题程序文件的编译错误分为连接错误和{{U}} 【7】 {{/U}}两类。
填空题下列程序的输出结果是{{U}} {{U}} {{/U}} {{/U}}。
#include<iostream. h>
void main()
{
double d=3.2;
int x,y;
x=1.2;
y=(x+ 3.8)/5.0;
cout<<y*d<<end1;
}
填空题在下面的类定义中,this指针的用途是{{U}} 【11】 {{/U}}。
#include <iostream. h>
class Sample
{
int x,y;
public:
Sample(int i,int j){x=i;y=j;
void asstgn(Sample sa):
};
void Sample: :assign(Sample p)
{
if (this! =
y=p.y;
}
}
填空题由于静态成员函数不属于某个具体的对象,但它属于某个{{U}} 【12】 {{/U}},所以它没有this指针。
填空题数组元素a[i]是该数组中的第 ______ 个元素。
填空题分析下列程序,并写出运行结果 [9] 。 #include<iostream.h> void main() int x[10]: int i=5,*ptr=x; *(ptr+i)=10; cout<<x[i]<<end1;
填空题栈的基本运算有三种:入栈、退栈和 【5】 。
填空题用链表表示线性表的突出优点是______。
填空题类的成员函数中,只能用于检测输入操作的函数是{{U}} [15] {{/U}}。
填空题C++中,设置虚基类的目的是 【10】 。
填空题表达式x.operator++( )还可写成{{U}} 【13】 {{/U}}。
填空题在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。
#include<iostream>
using namespace std;
class A
{
public: A(){cout<<'A';}
};
class B:{{U}} 【11】 {{/U}}
{
public:B(){cout<<'B';)
};
class C: {{U}}【12】 {{/U}}
{
public;C(){cout<<'C';}
};
class D:public B,public C
{
public:D(){cout<<'D';}
};
void main(){D obi;}
填空题以下程序的运行结果是 【8】 。#include<iostream.h>void main() bool t1=8,t2=0,t3=1;cout<<t1<<'/t'<<t2<<'/t'<<t3<<end1;
填空题下列软件系统结构图的宽度为{{U}}{{U}}{{/U}}{{/U}}。
填空题下列程序的输出结果是{{U}} 【9】 {{/U}}。
#include<iostream. h>
void main()
{
double d=3.2;
int x,y;
x=1.2;
y=(x+ 3.8)/5.0;
cout<<y*d<<end1;
}
填空题在C++中,一个数组名字实际上是指向该数组{{U}} 【9】 {{/U}}的指针。