Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language function problem: 1. Functions that do not need to return values, that is, functions that directly output values or symbols, must be defined as void types to be standardized.
C language function problem: 1. Functions that do not need to return values, that is, functions that directly output values or symbols, must be defined as void types to be standardized.
Void means that the function has no return value, so there is no need to write return. If there is no return value function, you should write void, otherwise the default return value is int type and a return statement is needed.

Functions can return multiple values in several ways:

First, if it is not returned, the return value of the function is still void, but the variable address is passed when the value is passed, so the value in the variable address will change when the function runs, and the external independent variable will also change when the function runs. Such as void fun(int* a).

Second, don't return. Functions pass values through global variables.

Third, return the array type (including the structure array), and return multiple values to be returned in the function in the array, such as char *fun ().