Today talk about the C language function, C language is through the function to implement the module, and modular programming. is to put a function or implement an algorithm to encapsulate it into a function, the advantage is: ① Our code will look neat, ②: We can debug, we will quickly find the error point, and then to correct.
Say how the function is defined: type name Function name (type parameter name, type argument name ...). {function Body} for example: int go (int a,int b) {}; Explanation: int is the type of the return value, the function name is the name you define for the function, the formal parameter in the parentheses, the argument to the parameter, and its corresponding arguments, so-called real arguments are the parameters that you pass when you call this function. For example, go (3,4), where 3,4 is the argument. The procedure for invoking a function is to first copy a copy of the argument to the parameter, then executes the body of the function and returns the return value at the end. Speaking of C language function, we must say its way of transmission, in fact, the C language of the value of a way, some people say there is also the address, in fact, the address is also transmitted to the value of the form parameter, but the argument is a pointer type of variable. After we say the value of the pass, we say the return value, which can actually be any type of value, including the value of the pointer type.
C Language Learning VI