explain call by value and call by reference

Call by value and call by reference explain 


Used when invoking functions

Call by value

Copy of argument passed to function
Changes in function do not effect original
Use when function does not need to modify argument
Avoids accidental changes

Call by reference

Passes original argument
Changes in function effect original
Only used with trusted functions
For now, we focus on call by value

Labels: