填空题
下列程序的运行结果为______。
#include<iostream.h>
class myclass
private:
int a,b,c;
public:
void fun( )
int a;
a=10;
this->a=5;
b=6;
this->c=7;
cout<<"a="<<a<<", this->a="<<this->a<<endl;
;
void main( )
myclass objl;
obj1.fun( );
【参考答案】
a=A0,this->a=E
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
参照函数模板的写法,完成非模板函数的定义,语句为______。 #include<iostream.h> #include<string.h> template<class T> T min(T a,T b) return(a<b a:b); char*rain(char*a,char*b) ______ void main( ) double a=1.23,b=3.45; char s1[]= abed ,s2[]= efg ; cout<<min(a,b)<<min(s1,s2)<<endl;
点击查看答案&解析
填空题
下列程序编译错误,因为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)<<endl;
点击查看答案&解析
相关试题
下列程序的运行结果是______。 #in...