填空题
下列程序的运行结果为
【14】
。
#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 obj1;
obj1.fun()
【参考答案】
a=A0, this->a=E
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
在下面的类定义中,this指针的用途是 【11】 。 #include <iostream. h> class Sample int x,y; public: Sample(int i,int j)x=i;y=j; void asstgn(Sample sa): ; void Sample: :assign(Sample p) if (this! =&p) x=p.x; y=p.y;
点击查看答案&解析
填空题
下列程序的运行结果为 【9】 。 #include<iostream, h> void main( ) int i; for(i=1; i<6;i++)if(i==3) break: com<< i= <<i<<end1;
点击查看答案&解析
相关试题
下列程序的运行结果是 【15】 。 #in...