C Programming Code Examples C > Beginners Lab Assignments Code Examples Function call by reference in C Programming Function call by reference in C Programming What is Function Call By Reference? When we call a function by passing the addresses of actual parameters then this way of calling the function is known as call by reference. In call by reference, the operation performed on formal parameters, affects the value of actual parameters because all the operations performed on the value stored in the address of actual parameters. It may sound confusing first but the following example would clear your doubts. #include <stdio.h> void increment(int *var) { /* Although we are performing the increment on variable var, however the var is a pointer that holds the address of variable j, which means the increment is actually done on the address where value of j is stored. */ *var = *var+1; } int main() { int j=20; /* This way of calling the function is known as call by * reference. Instead of passing the variable j, we are * passing the address of variable j */ increment(&j); printf("Value of j is: %d", j); return 0; }