1. function Parameters
(1) Function parameters are essentially the same as local variables, allocating space on the stack
(2) The initial value of the function parameter is the argument value at the time of the function call
(3) The Order of evaluation of the function parameters depends on the implementation of the compiler (note: This refers to the order of evaluation in sequence, not into the stacking sequence !) )
Evaluation order of "instance analysis" function parameters
#include <stdio.h>intFuncintIintj) {printf ("i =%d, j =%d\n", I, J); return 0;}intf () {printf ("f () call...\n"); return 1;}intg () {printf ("g () call...\n"); return 2;}intMain () {intK =1; intA =0; Func (k++,k++);//gcc, VC, bcc:2,1printf ("k =%d\n", k);//3a= f () * g ();//* Both sides of the operand sequence is not fixed, VC, Gcc:f () is called First, then G () return 0;}
2. sequence points in the program
(1) There are certain order points in the program.
(2) The sequential point refers to the latest moment when the value of the variable is modified during execution
(3) When the program arrives at the order point , all previous operations must be completed .
3. Order points in C language
(1) At the end of each complete expression, the semicolon
(2) &&, | |,?:, after each parameter of the comma expression is evaluated
(3) after all argument evaluation is completed on function call (before entering function body)
Sequential points in the programming experiment program
4. Summary
(1) The parameters of the function allocate space on the stack
(2) The argument of the function does not have a fixed order of calculation
(3) sequential point is the latest time for variable modification in C language
44th lesson The Secret of function parameters (i)