C Programming :: Basic Concepts - Discussion
65 / 90
C allows
Aonly call by value
Bonly call by reference
CBoth A & B
Donly call by value and sometimes call by reference
Show Explanation
call by value method of passing arguments to function copies the actual value of the arguments into the formal parameter of the function. In this case, changes made to the parameter inside the function, have no effect on the argument.
On the other hand,
call by reference method of passing arguments copies the address of the argument into the formal parameter. Inside the function, the address is used to access the actual argument used in the call. It means the changes made to the parameter affect the passed argument.
Asked In ::
C supports the following 2 methods of passing arguments to a function-
call by value method of passing arguments to function copies the actual value of the arguments into the formal parameter of the function. In this case, changes made to the parameter inside the function, have no effect on the argument.
On the other hand,
call by reference method of passing arguments copies the address of the argument into the formal parameter. Inside the function, the address is used to access the actual argument used in the call. It means the changes made to the parameter affect the passed argument.
Read Full Answer
Report Error
Please Login First Click Here