题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-26 20:54:43

[填空题]下列程序中的重载函数disp( )发生错误,错误原因是 【13】 。 # include<iostream, h> class Sample { private: int m; static int sr; public: Sample(int a) {m=a; st+=a; } static void disp( ){cout<<m<<end1; } static void disp(Sample input) { cout<<input. m<<end1; } }; int Sample: : st=2; void main( ) { Sample Eirst(2), Second(4) Sample: :disp( ); Sample: :disp (Second); }

更多"下列程序中的重载函数disp( )发生错误,错误原因是 【13】 。 "的相关试题:

[填空题]下列程序中的重载函数disp( )发生错误,错误原因是______。 #include<iostream.h> class Sample { private: int m; static int st; public: Sample(int a){m=a;st+=a;} static void disp( ){cout<<m<<endl;} static void disp(Sample input) { cout<<input.m<<endl; } }; int Sample::st=2; void main( ) { Sample First(2),Second(4); Sample::disp( ); Sample::disp(Second); }
[填空题]下列程序中的重载函数disp( )发生错误,错误原因是______。
#include<iostream.h>
class Sample

private:
int m;
static int st;
public:
Sample(int a)m=a;st+=a;
static void disp( )cout<<m<<endl;
static void disp(Sample input)

cout<<input.m<<endl;;
int Sample::st=2;
void main( )

Sample First(2),Second(4);
Sample::disp( );
Sample::disp(Second);

[填空题]如下程序编译时发生错误,错误的原因是show函数实现语句错误,则正确的语句应该为 【8】
# include<iostream.h>
class testprivate:
int num;
public:
test(int)
void show( );
;
test: :test(int n) num=n;
test:: show( ) cout<<num<<end1;
void main( ) test T(10);
T. show ( );

[填空题]如下程序编译时发生错误,错误的原因是show函数实现语句错误,则正确的语句应该为______。 #include<iostream.h> class test { private: int hum; public: test(int); void show( ); }; test::test(int n){num=n;} test::show( ){cout<<num<<endl;} void main( ) { test T(10): T.show( ); }
[单项选择]在下面的运算符重载函数的原型中,错误的是(  )。
A. Volumeoperator-(double,double);
B. doubleVolume::operator-(double);
C. VolumeVolume::operator-(Volume);
D. Volumeoperator-(Volume);
[填空题]类class one 在声明func 成员函数时发生错误,出错原因是 【9】 。 Class one { private: int a; public: void func(two& ) }; class two { private: int b; friend void one: :func(two & ); }; void one: : func(two& r) a=r.b; }
[单项选择]以下程序中调用cin函数给变量a输入数值的方法是错误的,其错误原因是   #include   void main( )   { int *p,*q,a,b;   p=&a;   cout<<"input a:";   cin>>p;   }
A. *p表示的是指针变量p的地址
B. p表示的是变量a的地址,而不是变量a的值
C. *p表示的是指针变量p的值
D. *p只能用来说明p是一个指针变量
[填空题]重载函数的实现和功能不同,但函数的 相同。
[填空题]重载函数的函数名称相同,但函数的实现和功能不同,系统是靠 【12】 来决定采用哪个函数。
[填空题]函数重载要求重载的函数必须有和原函数一样的【 】。
[填空题]类clasg one在声明func成员函数时发生错误,出错原因是______。
class one
private:
int a;
public:
void func(two&);
;
class two

private:
int b;
friend vold one::func(two&);
;
void one::func(two&r)

a=r.b;

[填空题]类clasg one在声明func成员函数时发生错误,出错原因是______。 class one private: int a; public: void func(two&); }; class two { private: int b; friend vold one::func(two&); }; void one::func(two&r) { a=r.b; }
[填空题]函数重载要求重载的函数必须有和原函数一样的 【10】

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码