填空题

下列程序的运行结果是 【9】 。 # include <iostream. h> class test { private: int num; public: test() int TEST() {return num+100;} ~test() }; test::test(){num=0;} test::~test(){cout<<"Destructor is active"<<endl;} void main() { test x[3] cout<<x[1]. TEST()<<endl; }

【参考答案】

100
<上一题 目录 下一题>
热门 试题

填空题
根据输出结果填空完成下面程序。# include<iostream. h>class Test{private:static int val;int a;public:static int func( );void sfunc(Test &r);};【8】 初始化静态变量valint Test::func(){return val++;}void Test::sfunc(Test &r)r. a=125;cout<< Result3= <<r.a;}void main( ){cout<< Resultl= <<Test::func( )<<endl;Test a;cout<< Result2= <<a. func( );a. sfunc(a)}
填空题
执行语句序列char strl[10]= ABCD ,str2[10]= XYZxyz ;for (int i=0; strl[i]=str2[i]; i++)后,数组str1中的字符是XYZxyz,数组str2中的字符串是 【6】 。
相关试题
  • 下列程序对加号进行了重载,划线部分的语句...
  • 下列程序用于打印出ASCⅡ字符,其析构函数...
  • 下列程序的运行结果是 【11】 。# in...
  • 下列程序的执行结果是 【7】 。include...
  • 下列程序的运行结果是 【13】 。# in...