The formal parameter appears in the function definition and can be used throughout the body of the function, leaving the function unused.
The argument appears in the keynote function, and when it enters the function, the real parametric is not used .
The keynote function transmits the value of the argument to the parameter of the modulated function, thus realizing the transfer of the keynote function to the transferred function .
1. Parametric the memory unit is allocated only when called, releasing the allocated memory unit immediately at the end of the call . Therefore, the formal parameter is valid only within the function. The parameter variable can no longer be used when the function call finishes returning the keynote function.
2. Arguments can be constants, variables, expressions, functions, and so on, regardless of the type of argument, and when making a function call, they must have a definite value in order to pass these values to the parameter. Therefore, an assignment, input, and so on should be used to obtain a definite value for the argument.
4. The data transfer that occurs in a function call is one-way . That is, the value of the argument can only be passed to the parameter, and the value of the parameter cannot be passed to the argument in reverse. Therefore, during a function call, the value of the formal parameter changes, and the value in the argument does not change.
5. When a formal parameter and an argument are not pointer types, when the function is run, the formal parameters and arguments are different variables, they are in different locations in memory, the contents of the arguments arguments are copied, and the parameters are freed at the end of the function's run, and the argument content does not change . and if the function's argument is a pointer-type variable, in the process of invoking the function, the address of the argument to the function, which is used inside the function body is also the address of the argument, that is, the argument itself is used . Therefore, the value of the argument can be changed inside the function body.
The simple point is actually
The argument is the value after the formal parameter is assigned, and it is useful to participate in the actual operation.
The difference between a formal parameter and an argument