在下面的类定义中,横线处应填入的内容是 class Fred { public: void print () { cout<<data<<end1;} void setData (double D) {data=d; static int count; private: double data; };______count=0; //静态数据成员的定义A.intB.static intC.int Fred::D.static int Fred::

在下面的类定义中,横线处应填入的内容是 class Fred { public: void print () { cout<<data<<end1;} void setData (double D) {data=d; static int count; private: double data; };______count=0; //静态数据成员的定义

A.int

B.static int

C.int Fred::

D.static int Fred::


相关考题:

在下面的类定义中,横线处应填入的内容是 class Fred { public: void print(){cout<<data<<endl;} void setData(double d)(data=d;} static int count; private: double data; }; count=0; //静态数据成员的定义A.intB.static intC.int Fred::D.static int Fred::

请将下列类定义补充完整,横线处应填加语句______。class TestClass{public:void fun(){cout<<"Base::fun"<<end1;}};class TestClass1:public TestClass{public:voidfun(){______;//显示调用基类的fun函数cout<<"TestClass1::fun"<<end1;}};

下列程序的运行结果是【 】。 include class SomeClass { public: SomeClass(int va 下列程序的运行结果是【 】。include <iostream. h>class SomeClass{public:SomeClass(int value) { some_value=value;};void show_data(void) { cout<<data<<"<<~some_value<<endl; };static void set_data(int value) {data=value; }private:static int data;int some_value};int SomeClass::datavoid main(void){SomeClass my_class(1001),your_class(2002);your_class. set_data(4004);my_elass. show_data()}

下列程序中声明了两个类AA和BB,其中函数“print”是类AA的成员函数,但是类BB的友元函数。请在①、②和⑧处各填入正确的内容,使程序能正常运行。include<iostream.h>【 】;class AA{int t;public:AA(int x){t=x;}void print(BB b) ;};class BB{int s;public:BB(int y){s=y;}friend void 【 】 print(BB );};void 【 】{ cout<<"AA:"<<t<<"BB: "<<w.s<<end1;}<void main(){AA m(6);BB n(8);m.print(n);}输出结果为:AA:6;BB:8

在下面的定义语句中,画线处应填入的内容是 class Fred{ public: void print( ){cout<<data<<endl;} void setData(double D) {data=d;} static int count; private: double data; }; ______count=0;//静态数据成员的定义A.intB.static intC.int Fred::D.static int Fred::

在下列横线处应添加的语句是( )。 class Base{public:void fun(){cout<<"Base::fun"<<end1;}}; class: Derived: public Base { public: void fun() { ______//显示调用基类的fun函数 cout<<"Derived::fun"<<end1; } };A.Derived::funB.Base::fun();C.Pubic::funD.fun();

应在下列程序画线处填入的正确语句是 ( )。include using namespace std;clas Base{pu 应在下列程序画线处填入的正确语句是 ( )。 #include <iostream> using namespace std; clas Base { public: void fun() { cout<<"Base::fun"<<end1; } }; class Derived : public Base { void fun() { ________________//显示调用基类的函数 fun() cout<<"Derived::fun"<<end1; } };A.fun();B.Base.fun();C.Base::fun();D.Base->fun();

在下面的类定义中,横线处应填入的内容是______ 。 class Fred { public: void print(){ cout << data << end 1; } void setData(double d) { data=d; } static int count; private: double data; }; ______count=0;//表态数据成员的定义A.intB.static intC.int Fred::D.static int Fred::

在下面的类定义中,横线处应填入的内容是( )。class Fred{ public: void print() {cout<<data<<end1; void setData(double d)( data=d; static int count; private: double data;};_______________________ count=O; //静态数据成员的定义A.intB.static intC.int Fred::D.static int Fred::