What is the difference between call by value and call by reference in C?

Fill In The Blank
Views 1073

Answer:

Following are the differences between a call by value and call by reference are:

  Call by value Call by reference
Description When a copy of the value is passed to the function, then the original value is not modified. When a copy of the value is passed to the function, then the original value is modified.
Memory location Actual arguments and formal arguments are created in separate memory locations. Actual arguments and formal arguments are created in the same memory location.
Safety In this case, actual arguments remain safe as they cannot be modified. In this case, actual arguments are not reliable, as they are modified.
Arguments The copies of the actual arguments are passed to the formal arguments. The addresses of actual arguments are passed to their respective formal arguments.

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of C Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.