+ 2

Please illustrate me the concept of call by value and call by refrence

call by value and call by reference

4th Feb 2017, 6:05 AM
Ashutosh Saraf
Ashutosh Saraf - avatar
2 Answers
+ 12
Whats the difference between call by value and call by reference ?? [In detail] in this question u will find the answer
5th Feb 2017, 11:09 AM
‎‏‎‏‎Kueen
‎‏‎‏‎Kueen - avatar
+ 1
to be short... Call by value is the classic method in a function call. Inside the function is created a local copy of variable you pass to the function and any operation and/or mldification inside the function is done on the local copy. When the function ends the local copy is destroyed. The original variable cannot be modified. Call by reference implys to pass a function the memory location where the variable is stored. Any change is done on the original memory location and, at the end of function, the variable the modifications on the variable are effective. The variable passed can be modifyed by the calling function.
4th Feb 2017, 6:59 AM
pasquale napolitano
pasquale napolitano - avatar