C + + defines the conversion criteria between a set of built-in type objects, which are implicitly converted by the compiler when necessary
1. In the arithmetic expression of mixed operation, the widest data type becomes the target conversion type
2. When assigning values between different types of expressions, the object type being assigned becomes the target conversion type
3. When the function call argument is inconsistent with the parameter type, the object type of the formal parameter becomes the target conversion type
4. When the function's return value type is different from the type of the function expression, the type of the function expression becomes the target conversion type
Note: Two common guidelines for arithmetic operations are as follows
(1) In order to prevent the loss of precision, the type is always promoted to a wider type.
(2) All arithmetic expressions with ordered types that contain less than integers are converted to integer (that is, integer promotion) before they are evaluated and then converted to the defined type.
C + + Implicit type conversion