Points to Remember
- When calling a function by reference, the actual parameter is the address of the variable that is being called.
- Since the address of the actual parameters is passed, the value of the actual parameters can be altered.
- Changes performed inside the function remain valid outside of it. By altering the formal parameters, the values of the real parameters actually change.
- Both actual and formal parameters refer to the same memory location.
Pass By Reference In C
Passing by reference is a technique for passing parameters to a function. It is also known as call by reference, call by pointers, and pass by pointers. In this article, we will discuss this technique and how to implement it in our C program.