+ 1
It's quite simple: call-by-value copies the parameter you pass to a variable that is local to the function. Any changes done to this variable on the function will not be reflected in the variable you put as a parameter in the function call. Call-by-reference on the other hand doesn't pass a copy of the parameter from the call but a reference to this parameter. This reference acts as an alias to the original parameter in the call. Consequentially, changes you make to the parameter in the function will be reflected in the variable you passed in the call.
19th Aug 2016, 4:01 PM
Stefan
Stefan - avatar