First page Back Continue Last page Overview Graphics

Parameter Passing in Detail

There are generally two kinds of parameter passing:

call-by-value

call-by-reference

The argument expression is evaluated, and the resulting value is bound to the corresponding variable in the function (frequently by copying the value into a new memory region).

The argument is a reference rather than a copy of a value. This typically means that the function can modify the argument. Call-by-reference has the advantage of greater time- and space-efficiency