Functions (cont)
When a function is called:
- the arguments in the calling function are evaluated
- C uses "call-by-value" parameter passing …
- the function works only on its own local copies of the parameters, not the ones in the calling function
- function code is executed, until a
return statement is reached
- the returned
expression will be evaluated
- the calling function is free to use the returned value, or to ignore it
The return statement can also be used to terminate a function of return-type void :
|