填空题
下列程序编译错误,因为add函数返回值是一个引用,故对return后返回值的要求是______。
#include<iostream. h>
int& add(int x, int y)
return x+y;
void main( )
int i=3,j=19;
cout<<(add(i,j)+ =20)<<end1;
【参考答案】
不能是表达式
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
有如下程序: #include<iostream> using namespaee std;c lass Animal public: virtual char*getType( )constreturn Animal ; virtual char*getVoice( )constreturn Voice ; ; class Dog:public Animal public: char*getType( )constreturn Dog ; char*getVoice( )eonstreturn Woof ; ; void type(Animal&A) cout<<a.getType( ); void speak(Animal A) eout<<a.getVoice( ); int main( ) Dog d;type(D) ;cout<< speak ;speak(D) ;cout< return 0; 程序的输出结果是______。
点击查看答案&解析
填空题
目前,有两种重要的高级语言,分别是结构化程序和______。
点击查看答案
相关试题
要在类的对象上使用运算符,除了运算符__...