填空题下列程序编译时发现pb->f(10);语句出现错误,其原因是______。 #include<iostream.h> class Base public: void f(int x)cout<<"Base:"<<x<<endl;) ; class Derived:public Base public: void f(char*str)cout<<"Derived:"<<str<<endl; ; void main(void) Derived*pd=new Derived; Pd->f(10);
填空题在结构化设计方法中,数据流图表达了问题中的数据流与加工间的关系,且每一个 ______实际上对应一个处理模块。
填空题若已定义,以下fun函数的功能是:在第一个循环中给前10个数组元素依次赋1、2、3、 4、5、6、7、8、9、10;在第二个循环中使a数组前10个元素中的值对称折叠,变成1、 2、3、4、5、5、4、3、2、1。请填空。 fun(int a[]) int i; for(i=1;i<=10;i++) 【9】 =i; for(i=0;i<5;i++) 【10】 a[i];
填空题在C++中,包含了处理用户控制的文件操作所需的信息是指头文件中的{{U}} {{U}} {{/U}} {{/U}}。
填空题以下程序的输出结果是 【10】 。 #include<iostream.h> unsigned fun (unsigned num) unsigned k=1; dok*=num%10;num/=10; while(num); return k; void main( ) unsigned n=26; cout <<fun(n) <<end1;
填空题补充完整下面的模板定义:
template<class Type> //Type为类型参数
class Xtwo{ //由两个Type类型的数据成员构成的模板类
Type a;
Type b;
public:
Xtwo(Type aa=0,Type bb=0):a(aa),b(bb){}
int Compare( ){ //比较a和b的大小)
if(a>b) return 1;
else if(a= =b) return 0;
else return -1;
}
Type Sum( ){return a+b;)//返回a和b之和
Type Mult( ); //函数声明,返回a和b之乘积
};
template<class Type>
______::Mult( ){ return a*b;}//Mult函数的类外定义
填空题需求分析最终结果是产生
________
。
填空题数据库系统的主要特点为数据集成性、数据的高______和低冗余性、数据独立性和数据统一管理和控制。
填空题将x+y*z中的“+”用成员函数重载,“*”用友元函数重载应写为 【15】 。
填空题重载的流运算符函数经常定义为类的{{U}} 【14】 {{/U}}函数。
填空题如果类B继承了类A,则称类A为类B的基类,类B称为类A的{{U}} 【10】 {{/U}}。
填空题以下程序的输出结果是{{U}} 【10】 {{/U}}。
#include <iostream>
using namespace std;
int main()
{
char S[ ]="abcdef";
s[3]='\0';
cout<<s<<end1;
return 0;
}
填空题用以下语句调用库函数malloc,使字符指针st指向具有11个字节的动态存储空间,请填空。 st=(char * ) ;
填空题有以下程序:
#include<iostream.h>
class A
{
int x;
public:
A(int a)
{
x=a;
}
friend class B;
}
class B{
public:
void print(A a){
a. x--;
cout<<a.x<<end1;
}
};
void main()
{
A a(10);
B b;
b.print(a) ;
}
程序执行后的输出结果是{{U}} 【14】 {{/U}}。
填空题C++中使用{{U}} [6] {{/U}}代替C语言中的宏。
填空题冒泡排序算法在最好的情况下的元素交换次数为{{U}} 【1】 {{/U}}。
填空题若要将一个模块的功能逐步分解,细化为一系列具体的步骤,进而用某种程序设计语言写成程序,应该在程序设计阶段采取 【2】 和逐步求精的方法。
填空题假定p所指对象的值为25,p+1所指对象的值为46,则执行“*p++;”语句后,p所指的对象的值为 【11】 。
填空题在下面函数的画线处填上适当的内容,使该函数能够利用递归方法求解字符串str的长度(不得使用系统提供的字符串处理函数)。 int GetLen(char*str) if( (6) )return (7) ; else return 1+GetLen(str+1);
填空题下面程序的运行结果是{{U}} 【10】 {{/U}}。
#include<iostream>
using namespace std;
class count
{
static int n;
public:
count()
{
n++;
}
static int test()
{
for(int i=0;i<4;i++)
n++;
return n;
} };
int count::n = 0;
int main()
{
cout<<count :: test()<<" ";
count c1, c2;
cout<<count :: test()<<end1;
return 0; }
