1. Differences between using a reload function as a member function and a friend function
A member function. One of the operands should be the class itself. During the call, the class object should be on the left, for example, c1 + 3. You can place the class in any position.
2. Overload ++, --; in the auto-increment (auto-subtraction) operator overload function, add an int-type parameter, that is, the Post-auto-increment (auto-increment) operator.
3. Reload stream insertion operator and stream extraction operator istream & operator> (istream &, custom class &) ostream & operator <(ostream &, custom class &) the overload of these two operators can only be used as friend functions or common functions, but cannot be defined as meta functions. Example: call operators when friend ostream & operator <(ostream &, Complex &); ostream & operator <(ostream & output, Complex & c) is overloaded <, when a member function is used for reload, the first parameter defaults to the object of this class, but for the io operator, the first parameter must be io, therefore, it can only be used as a binary friend function. This is because the compiler checks global functions and member functions during compilation. If there is an overload, it will connect to the overload operator, but the called object is still called, rather than the io is called, io is just a parameter.
4. Conversion constructor A: declare A class first. B: define a constructor with only one parameter in this class. The parameter type is the type to be converted, and the conversion method is formulated in the function body. C: In the scope of this class, you can use the following form for type conversion: class name (specified type of data)
5. Type conversion function: a type conversion function converts a class object to another type of data. Operator type name () {conversion statement}
<