Under what circumstances call by reference is to be preffered call by value

Call by value and call by reference is related to the c programming language, which is a general purpose, imperative computer language. Generally, programming languages consists of instruction for a computer. C programming language was originally developed from 1969 to 1973, which is used to re-inplement the Unix Operating System. On the basis arguments, there are two types of function that are available in C Languages such as with arguments and without arguments. If a function takes any arguments, ir must declare variables that accept the values as an argument. These variables are called parameters of the function.

Call by value and call by reference is two ways to pass values or data to.function in C-language. In call by value, original values cannot changed or modified while in call by reference, original values can be changed or modified.

In call by value, any changes made are reflected in the actual argument while in call by reference, the changes made are reflected in the actual argument. Call by Value (CBV) can be implemented only in the C language but not in C++ and Java while Call by Reference (CBR) can be implemented in C++ and Java. Call by Value works on locally while call by reference works globally.

These properties of call by reference make to be preferred over call by value.

Leave a Reply