首页
题库
网课
在线模考
桌面端
登录
搜标题
搜题干
搜选项
0
/ 200字
搜索
填空题
如果要把返回值为void的函数A声明为类B的友元函数,则应在类B的定义中加入的语句是______。
此题暂无答案
在线练习
手机看题
你可能感兴趣的试题
填空题
{{*HTML*}}数据库应用的核心是指
__
____
__
。
此题暂无答案
手机看题
填空题
{{*HTML*}}若要将函数“void FriFun(){};”声明为类MyClass的友元函数,则应在类MyClass的定义中加入语句______。
此题暂无答案
手机看题
填空题
{{*HTML*}}补充完整下面的模板定义:
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函数的类外定义
此题暂无答案
手机看题
填空题
{{*HTML*}}请定义一个函数名为A,返回值为int,没有参数的纯虚函数的定义是,
__
____
__
。
此题暂无答案
手机看题
填空题
{{*HTML*}}______允许用户为类定义一种模式,使得类中的某些数据成员及某些成员函数的返回位能取任意类型。
此题暂无答案
手机看题
填空题
{{*HTML*}}一个C++程序的开发步骤通常包括编辑、______、链接、运行和调试。
此题暂无答案
手机看题
填空题
{{*HTML*}}类是一个支持集成的抽象数据类型,而对象是类的______。
此题暂无答案
手机看题
填空题
{{*HTML*}}大多数C++程序都要包含 ______ 头文件。该文件中包含了所有输入/输出流操作所需要的基本信息。
此题暂无答案
手机看题
填空题
如果要把返回值为void的函数A声明为类B的友元函数,则应在类B的定义中加入的语句是______。
此题暂无答案
手机看题
填空题
{{*HTML*}}·、·*、->、::、?:这五个运算符______重载。
此题暂无答案
手机看题
填空题
{{*HTML*}}如下类定义中包含了构造函数和拷贝构造函数的原型声明,请在横线处填写正确的内容,使拷贝构造函数的声明完整。
Class myClass{
private:
int data;
public:
myClass(int value);//构造函数
myClass(const
__
____
__
anotherObject);//拷贝构造函数
}
此题暂无答案
手机看题
填空题
{{*HTML*}}在下面的程序的横线处填上适当的语句,使该程序的输出为12。
#include 〈iostream〉
using namespace std;
class Base
{
public:
int a;
Base(int i) { a=i;}
};
class Derived : public Base
{
int a;
public:
Derived(int x) : Base(x),b(x+1) {}
void show()
{
______; //输出基类数据成员a的值
cout〈〈b〈〈end1;
}
};
int main()
{
Derived d(1);
d.show();
return 0;
}
此题暂无答案
手机看题
填空题
{{*HTML*}}有以下程序:
#include<fstream>
#include<string>
using namespace std;
int main(){
char ch[]="The end";
ofstream outstr("______",ios_base::app);
for(int i=0;i<strlen(ch); i++) outstr.put(ch[i]);
outstr.close();
return 0:
}
若程序实现的功能是在文件d:\put.txt的尾部追加写入一串字符,试将程序补充完整。
此题暂无答案
手机看题
填空题
{{*HTML*}}数据的逻辑结构在计算机存储空间中的存放形式称为数据的______。
此题暂无答案
手机看题
填空题
{{*HTML*}}在结构化分析方法中,用于描述系统中所用到的全部数据和文件的文档称为
__
____
__
。
此题暂无答案
手机看题
填空题
{{*HTML*}}有如下程序:
#include<iostream>
using namespace std;
class Animal{
public:
virtual char*getType( )const{ return "Animal";}
virtual char*getVoice( )const{ return "Voice";)
};
class Dog: public Animal{
public:
char*getType( )const{return "Dog";)
char*getVoice( )const{return "Woof";}
};
void type(Animal& a){ cout<<a.getType( );}
void sDeak(Animal a){ cout<<a.getVoice( );}
int main( ){
Dog d;type(d);cout<<"speak";speak(d);cout<<endl;
return 0;
}
运行时的输出结果是______。
此题暂无答案
手机看题
填空题
{{*HTML*}}在计算机软件系统的体系结构中,数据库管理系统位于用户和
__
____
__
之间。
此题暂无答案
手机看题
填空题
{{*HTML*}}请将下列模板类Data补充完整。
template<typename T>
class Data{
public:
void put(T v){val=v;}
______get() //返回数据成员val的值,返回类型不加转换
{return val;}
private:
T val;
};
此题暂无答案
手机看题
微信扫码免费搜题