计算机二级

重载输入流运算符>>必须使用的原型为A.istream& operator>>(istream&,&);B.is重载输入流运算符>>必须使用的原型为A.istream& operator>>(istream&,<类名>&);B.istream& operator>>(istream,<类名>);C.istream operator>>(istream,<类名>&);D.<类名>operator>>(istream&,<类名>&);

题目
重载输入流运算符>>必须使用的原型为A.istream& operator>>(istream&,<类名>&);B.is

重载输入流运算符>>必须使用的原型为

A.istream& operator>>(istream&,<类名>&);

B.istream& operator>>(istream,<类名>);

C.istream operator>>(istream,<类名>&);

D.<类名>operator>>(istream&,<类名>&);

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

2、重载输入流运算符>>必须使用的原型为:

A.ostream&operator>>(ostream&,<类名>);

B.istream&operator>>(istream&,<类名>&);

C.ostream&operator>>(ostream,<类名>&);

D.<类名> operator>>(istream&,<类名>&);


istream&operator>>(istream&,< 类名 >&);

第2题:

重载输入流运算符>>必须使用的原型为A.ostream& operator>>(ostream&,<类名>);B.istream

重载输入流运算符>>必须使用的原型为

A.ostream& operator>>(ostream&,<类名>);

B.istream& operator>>(istream&,<类名>&);

C.ostream operator>>(ostream,<类名>&);

D.<类名>operator>>(istream&,<类名>&);


正确答案:A
解析:本题考核运算符的重载。C++中重载输入流运算符>>和输出流运算符只能作为非类成员函数重载,且必须使用如下原形:istream&operator>>(istream&,类名>&);ostream&operator(ostream&,类名>);

第3题:

重载输入流运算符>>必须使用的原型为A.istream& operator >>(istream&,<类名>&);B.i

重载输入流运算符>>必须使用的原型为

A.istream& operator >>(istream&,<类名>&);

B.istream& operator >>(istream,<类名>);

C.istream operator >> (istream,<类名>&);

D.<类名> operator >>(istream&,<类名>&);


正确答案:A
解析:本题考核运算符的重载。C++中重载输入流运算符>>和输出流运算符只能作为非类成员函数重载,且必须使用如下原形:istream&operator>>(istream&,类名>&);ostream&operator(ostream&,类名>):

第4题:

重载输入流运算符>>必须使用的原型为()。A.istream& operator>>(istream&,<类名>&);B

重载输入流运算符>>必须使用的原型为( )。

A.istream& operator>>(istream&,<类名>&);

B.istream& operator>>(istream,<类名>);

C.istream operator>>(istream,<类名>&);

D.<类名>operator>>(istream&,<类名>&);


正确答案:A
解析: C++流的输入运算符“>>”和输出运算符“”只能作为非成员函数重载。重载输入流运算符“>>”须使用以下原型:istream&operator>>(istream&,类名>&);。

第5题:

重载输入流运算符>>必须使用的原型为A.istream& operator >> (istream&,<类名>&);B.

重载输入流运算符>>必须使用的原型为

A.istream& operator >> (istream&,<类名>&);

B.istream& operator >>(istream,<类名>);

C.istream operator>>(istream,<类名>&);

D.<类名>operator >>(istream &,<类名>&);


正确答案:A
解析:本题考核运算符的重载。C++中重载输入流运算符>>和输出流运算符只能作为非类成员函数重载,且必须使用如下原形:istream&operator>>(istream&,类名>&);ostream&operator(ostream&,类名>);

第6题:

重载输入流运算符<<必须使用的原型为()。A.ostream& operator>>(ostream&,<类名>);B.istr

重载输入流运算符<<必须使用的原型为( )。

A.ostream& operator>>(ostream&,<类名>);

B.istream& operator>>(istream&,<类名>&);

C.ostream operator>>(ostream,<类名>&);

D.<类名>operator>>(istream &,<类名>&);


正确答案:A

第7题:

重载输人流运算符>>必须使用的原型为( )。

A.istream&operator>>(istream&,<类名>&);

B.istream&operator>>(istream,<类名>);

C.istreamoperator>>(istream,<类名>&);

D.<类名>operator>>(istream&,<类名>&);


正确答案:D
A。【解析】C++流的输入运算符“>>”和输出运算符“<<”只能作为非成员函数重载。重载输入流运算符“>>”须使用的原型是istream&operator>>(istream&,<类名>&);。

第8题:

重载输入流运算符<<必须使用的原型为A.ostream& operator>>(ostream&,<类名>);B.istream

重载输入流运算符<<必须使用的原型为

A.ostream& operator>>(ostream&,<类名>);

B.istream&o perator>>(istream&,<类名>&);

C.ostream operator>>(ostream,<类名>&);

D.<类名>operator>>(istream&,<类名>&);


正确答案:A
解析:本题考核运算符的重载。C++中重载输入流运算符>>和输出流运算符只能作为非类成员函数重载,且必须使用如下原形:istream&operator>>(istream&,类名>&);ostream&operator(ostream&,类名>);

第9题:

重载输入流运算符))必须使用的原型为()。A.istream&operator>>(istream&,<类名>&);B.

重载输入流运算符))必须使用的原型为( )。

A.istream&operator>>(istream&,<类名>&);

B.istream&operator>>(istream,<类名>);

C.istreamoperator>>(istream,<类名>&);

D.<类名>operator>>(istream&,<类名>&);


正确答案:A
解析: C++流的输入运算符“>>”和输出运算符“”只能作为非成员函数重载。重载输入流运算符“>>”须使用以下原型:istream&operator>>(istream&,类名>&);。