__________A.receiveB.friendC.fieldD.piece
__________
A.receive
B.friend
C.field
D.piece
B.friend
C.field
D.piece
参考解析
解析:
相关考题:
已知类Myst有一个只需要一个double型参数的构造函数,且将运算符“-”重载为友元函数。要使语句序列Myst x (3.2),y(5.5),z(0.0); z=8.9-y; y=x-6.3; 能够正常运行,运算符函数operator-应在类中声明为( )。A.friend Myst operator- (Myst, Myst);B.friend Myst operator- (Myst,Myst);C.friend Myst operator- (Myst,Myst);D.friend Myst operator- (Myst,Myst);
为使下列程序的正确输出结果为: Now is 2004-7-6 12:12:12 那么应该在程序划线处填入的语句是( )。 #include <iostream> using namespace std; class TIME; class DATE { public: DATE(int y=2004,int m=1,int d=1) { year=y; month=m; day=d; } void DateTime(TIME t); private: int year,month, day; }; class TIME { public: TIME(int h=0,int m=0,int s=0) { hour=h; minute=m; second=s; } ______________; //将类 DATE 中成员函数 DateTime 声明为类 TIME 的友元函数 private: int hour,minute, second; }; void DATE: :DateTime(TIME t) { cout<<"Now is "<<year<<'-'<<month<<'-'<<day<< ' '<<t.hour<<":"<<t.minute<<': '<<t.seoond<<'.'<<end1; } int main ( ) { DATE d(2004,7,6); TIME t (12, 12, 12); d. DateTime (t); return 0; }A.friend void DateTime(TIME t);B.friend void DATE::DateTime(TIME 0;C.void DateTime(TIME t);D.friend void DateTime(TIME t);
有如下类定义: class MyClass { public: private: ______________________________________ int data; }; 若要为MyClass类重载流输入运算符“”,使得程序中可以“cinobj;”的形式改变MyClass类的对象0bj中数据成员data的值,则横线处的声明语句应为( )。A.friend istream operator(istreamis,MyClassA.;B.friend istreamoperator(istreamis,MyClass A.;C.istreamoperator(istreamis,MyClassA.;D.istreamoperator(istreamis,MyClass A.;
类模板templateclass x{...},其中,友元函数f对特定类型T(如int),使函数 f(x);成为 类模板template<class T>class x{...},其中,友元函数f对特定类型T(如int),使函数 f(x<int>);成为x<int>模板类的友元,则其说明为( )。A.friend void f();B.friend void f(x<T>);C.friend void A:: f()D.friend void C<D:: f(x<T>);
类模板templateclass x{…},其中友元函数f对特定类型T(如int),使函数f(x)成为x 类模板template<class T>class x{…},其中友元函数f对特定类型T(如int),使函数f(x<int>)成为x<int>模板类的友元,则其说明为( )。A.friend voidf();B.friend voidf(x<T>);C.friend voidA::f();D.friend void C<T>::f(x<T>);
若要把函数void fun()定义为TestClass的友元函数,则应该在类TestClass的定义中加入的语句是( )A.void friend fun()B.friend fun()C.friend void fun()D.TestClass void fun()
已知类Myst有一个只需要一个double型参数的构造函数,且将运算符“-”重载为 友元函数。要使语句序列 Myst x(3.2),y(5.5),z(0.0); z=8 .9-y; y=x-6 .3; 能够正常运行,运算符函数operator-应该在类中声明为( )。A.friend Myst operator-(Myst,Myst);B.friend Myst operator-(Myst,Myst);C.friend Myst operator-(Myst,Myst);D.friend Myst operator-(Myst,Myst);
收到;接受;选择( )。A.receive;accept;choiceB.receive;choice;acceptC.accept:receive;choiceD.accept;choice;receive