|
Calling Functions |
Calling Functions: Call by Value and Call by Reference.
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
We will use it with Arrays and pointers
For now, we focus on call by value .