Computer Science, asked by nidhiagarwal, 1 year ago

Give the advantage of call by value over call by reference

Answers

Answered by AniruddhParwal
2
In call by value we get the value in new variable ...so, what ever operation we do on new variable ...the main variable does not get affected.

Hope this will help You..
reply if there is any query 
Answered by shambhavi112000
1
In Call by Value method value of actual parameter are copied into the formal parameter that is the function creates it's own copy of argument values and works on this value whatever change takes place are not reflected back to the original own actual variable or parameter because function does not have access to the original variables this type of calling is useful if original values are not to be modified


In Call by Reference method in place of passing value to the function reference of the original variable is passed which stores the address of memory location of the variable therefore the formal parameter become reference to the actual parameter in the calling function in this method the function does not creates its own copy but refers to the original values by different name that is reference therefore the called function works with the original data and any change in the values gets reflected in the original variable
Similar questions