Distinguish between call by value and call by reference.
Call by value
|
Call by reference
|
A copy of actual arguments is passed to respective formal arguments.
|
The address of actual arguments is passed to formal arguments
|
Actual arguments will remain safe, they cannot be modified accidentally.
|
Alteration to actual arguments is possible within from called function; therefore the code must handle arguments carefully else you get unexpected results.
|
Address of the actual and formal arguments are different
|
Address of the actual and formal arguments are the same
|
Changes made inside the function is not reflected in other functions
|
Changes made in the function is reflected outside also.
|