niusouti.com

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

题目
重载输入流运算符<<必须使用的原型为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&,类名>);
更多“重载输入流运算符<<必须使用的原型为A.ostream&amp; operator>>(ostream&amp;,<类名>);B.istream ”相关问题
  • 第1题:

    重载输入流运算符>>必须使用的原型为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&,类名>);

  • 第2题:

    重载输入流运算符>>必须使用的原型为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&,类名>):

  • 第3题:

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

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

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

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

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


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

  • 第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.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&,类名>);