![]() |
![]() |
![]() |
![]() |
![]() |
|
Now suppose that a function is to return the value of a call-by-value parameter or of a local variable. Normally, the C++ compiler arranges, by default, for such values to be copied before they are lost:
Reserved for
call-by-value parameter
whose value is returned
|
v
----------
*---------*---------*---------*---------*---------*---------*
| In use | In use | In use | In use | In use | Unused |
*---------*---------*---------*---------*---------*---------*
|
|
|
Memory reserved | Value copied
for returned value | during return
*---------* |
| | <----------------------*
*---------*