填空题

下列程序的运行结果为 【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
<上一题 目录 下一题>
热门 试题

填空题
下列程序的运行结果是 【15】 。#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;}~De rived() {cout << Derived= <<b<<’’;}void main(){Derived dl (9)}
填空题
参照函数模板的写法,完成非模板函数的定义,语句为 【12】 。#include<iostream, h>#include<string. h>template<class T>T min(T a, T b){ return(a<b a:b);} char * min(char * a, char * b){__________________________ }void main(){double a=1.23,b=3.45;char s1[]= abcd ,s2[]= erg ;cout<<min(a, b)<<min(s1,s2)<<end1:}
相关试题
  • 以下不能够读入空格字符的语句是
  • 对于常数据成员,下面描述正确的是
  • 下述说法错误的是
  • 以下的for循环 for(x=0,y=0,(y!...
  • 在结构化分析方法中,数据字典的作用是