Review
Recall that a function using call-by-value formal parameters performs the following set of steps:
- expressions used as arguments are evaluate
- values of variables or expressions are coerced, if necessary, and then copied into the corresponding formal parameters
- function body is executed
- return expression is evaluated and coerced if necessary
- return value is substituted for the function call
-
When we use a call-by-reference formal parameter, the corresponding argument in a function call must be a varialble and this argument variable is substituted for the formal parameter
So only step 2 above changes but it’s an important change