填空题

下列程序的运行结果为______。 #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>class Sample{int a;public:Sample(int aa=0){a=aa;}~Sample( ){cout~<< Sample= <<a<<’’;}};class Derived:public Sample{int b;public:Derived(int aa=0,int bb=0):Sample(aa)(b=bb;}~Derived( ){cout<< Derived= <<b<< ;}};void main( ){Derived d1(9);}
填空题
下列程序编译错误,因为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;}
相关试题
  • 设有如图所示的二叉树则对该二叉树中序遍历...
  • 下列各类函数中,不是类的成员函数的是
  • 一个人有一个身份证号码,一个身份证号码对...
  • 以下叙述正确的是
  • 如果一个类含有一个以上的纯虚函数,则称该类为