选择题:有如下程序 #include <iostream> using namespace std; int i=1; class Fun {

题目内容:
有如下程序 #include <iostream> using namespace std; int i=1; class Fun { public: static int i; int value( ){ return i-l;} int value( )const { return i+1;} }; int Fun::i=2; int main( ){ int i=3; Fun funl; const Fun fun2; ___________ return 0; } 若程序的输出结果是: 123 则程序中下划线处遗漏的语句是

A.cout<<funl.value( )<<Fun::i<<fun2.value( );

B.cout<<Fun::i<<funl.value()<<fun2.value( );

C.cout<<funl.value( )<<fun2.value( )<<Fun::i;

D.cout<<fun2.value( )<<Fun::i<<fun1.value( );




参考答案:

有如下程序: #include <iostream> using namespace std; class Obj { static in

有如下程序: #include <iostream> using namespace std; class Obj { static in

查看答案

有如下程序 #include <iostream> using namespace std; class Base { protected:

有如下程序 #include <iostream> using namespace std; class Base { protected:

查看答案

有如下类定义: class MyBase { int k; public: MyBase(int n=0):k(n) { }

有如下类定义: class MyBase { int k; public: MyBase(int n=0):k(n) { }

查看答案

在一个派生类对象结束其生命周期时A.先调用派生类的析构函数后调用基类的析构函数B.先调用基类的

在一个派生类对象结束其生命周期时A.先调用派生类的析构函数后调用基类的析构函数B.先调用基类的

查看答案

有如下的运算符重载函数定义: double operator +(int i,int k){return double(i+k);} 但定

有如下的运算符重载函数定义: double operator +(int i,int k){return double(i+k);} 但定

查看答案