return value:
1. The return value of the main () function: The main function main return value can be treated as a status indication, returning 0-bit success
2. Return non-reference type:
(1) The return value of the function is used to initialize the temporary object created when the function is called, and if the return type is not a reference, the return value of the function is copied to the temporary object where the function is called.
(2) When solving an expression, if a place is needed to store its results, the compiler creates an unnamed object.
(3) Initializing the temporary object with the function return value is the same as the initial taxiing parameter with the argument.
(4) When the return value is a non-reference type, the return value can be a local object, or it can be the result of solving an expression.
3. Return the reference type:
(1) When the function returns a reference type, the return value is not copied, instead, the object itself is returned.
(2) Never return a reference to a local object, or never return a pointer to a local object!
(3) When a reference is returned, it is required that in the parameters of the function, there are parameters that exist in the form of a reference or pointer, which need to be returned .
4. Const type:
(1) The return value cannot be modified
Return values for C + + functions