from Wiktionary, Creative Commons Attribution/Share-Alike License
- n. An evaluation strategy in which the arguments to a function are evaluated first, and a pointer to the result is passed to the function.
Sorry, no etymologies found.
In call-by-value, argument value is not altered in calling program but if passed using call-by-reference then changes done to the value of argument in the called function also gets reflected in the calling function.
In call-by-reference using pointers, we have dereferencing operator (*) in-between data-type and variable name.
Call-by-reference using reference variable has neatier code than inside function using call-by-reference using pointers.
However, if call-by-reference using pointers is used then you will have (&) in-between data-type and variable name in the calling program.
Now, you must be wondering how to decide when to use call-by-reference using pointer and when to use call-by-reference using reference variable.
In call-by-reference using reference variable, we have address-of (&) operator in-between data-type and variable name.
Now, question is when to use call-by-reference using pointer variable and when by reference variable.