The following is an example of calling the function code.
Example 1:
Try (int I) <---- I: formal Parameter
{
.......
}
Main ()
{
Int number = 1; <---- This is the value of the actual parameter number, that is, the value passed to the form parameter base, which is 1.
Try (number); <----- number: actual Parameter
}
C422.jpg (2661 bytes) can be a constant, variable, or even an expression.
Example 2:
Try (int base)
{
Base = base 5;
}
Main ()
{
Int number = 1;
Try (number );
}
In the preceding example, the parameter number and the format parameter base occupy different memory locations.
Example 3:
Main ()
{
Float duff (int);/* description in the called function */
Int n;
Float q;
...
Q = duff (n );
...
}
Float duff (int k)/* description in function definition */
{
Float tor;
...
Return (tor);/* returns a float value */
}
In calling a function, the description of the called function can only include parentheses and parameter types to distinguish it from a function.
C421.jpg (2871 bytes) when calling a function with formal parameters, we use actual parameters. The actual parameter is a special value assigned to the corresponding formal parameter during the call.