Call by Value and Call by Reference in C++

Call by Reference in C++, it permits us to pass parameters to the function by reference. When we pass the arguments by reference, the formal arguments in the called function becomes aliases to the actual arguments in the calling function that means when the function is working with its own arguments.

void swap(int *a, int *b)
 int n;
n=*a;           // assign the value at the address a to n //
swap(&x, &y);   // call by passing //