C overloads the operators and to implement the direct input and output of student clas

Updated on technology 2024-04-09
12 answers
  1. Anonymous users2024-02-07

    > operator (c reference).

    The Shift Right operator (> moves the first operand to the right by the number of bits specified by the second operand.

    Remark. If the first operand is int or uint (32 digits), the shift number is given by the lower five bits of the second operand (second operand & 0x1f).

    If the first operand is long or ulong (64 digits), the shift is given by the lower six bits of the second operand (second operand & 0x3f).

    If the first operand is int or long, the right shift is an arithmetic shift (the high-order vacancy is set to the sign bit). If the first operand is of type uint or ulong, then the right shift is a logical shift (the high bit is padded with 0).

    User-defined types can override >> operators; The first operand must be of type user-defined, and the second operand must be of type int. For more information, see Operator. When you overload a binary operator, the corresponding assignment operator, if any, is also implicitly overloaded.

    Example. / cs_operator_right_

    using system;

    class mainclass

    static void main()

    int i = -1000;

    Output: -125

  2. Anonymous users2024-02-06

    You can't overload the AND >> operators in C.

  3. Anonymous users2024-02-05

    There is no <<> such a symbol in C, you are an illegal operator. c doesn't seem to have such a thing as an overloaded operator.

  4. Anonymous users2024-02-04

    That's how I fell in love with you.

    That's how I fell in love with you. ***

  5. Anonymous users2024-02-03

    Your book is C++, Cout, Cin >> Input.

    C in "It's binary to the left,>> to the right...

  6. Anonymous users2024-02-02

    istream& operator>>(istream& in,student stu).

    istream& operator>>(istream& in,student& stu)

    Operator "also needs to be changed. Because you declare with & in class, and you don't have it in the implementation, this makes the compiler embarrassed.

  7. Anonymous users2024-02-01

    c There are three forms of readout.

    intstring

    consolekeyinfo

    Most of the means of implementing input are with readline() example int i;

    string s=;

    i = ;or i = ; Obtain the required data by string conversion.

  8. Anonymous users2024-01-31

    OOP is a way of thinking, regardless of the language.

    It's just that different languages have different levels of support.

    You seem to know the OOP perfectly.

  9. Anonymous users2024-01-30

    You can refer to the blog in my space, there is an example of a fractional class under the C++ classification, I hope it can help.

  10. Anonymous users2024-01-29

    Overloading is the arithmetic function of the actual operator, for example, class a and class b, class a has the variable aa, class b has the variable bb, the usual way is + = xx, after overloading it is a + b = xx,

  11. Anonymous users2024-01-28

    Let's review it more, it's not difficult, the knowledge you learn is your own, and no one can take it away.

  12. Anonymous users2024-01-27

    Study hard and stop fooling the teacher.

Related questions
19 answers2024-04-09

: has a higher priority than =

Below << >>>More

7 answers2024-04-09

+ Follow the right binding rule;

a=++i++;Equivalent to int temp=i++, a=++temp; >>>More

10 answers2024-04-09

Dizzy, the manager of the fifth level above, seeing that your level is quite high, why don't you give a decent answer? It's like a fortune teller. Nothing.

16 answers2024-04-09

The operator priority should be at the end of each C textbook with a table, according to which you should choose! Not.