C++ Function Pass By Reference

C++ Function Pass By Reference


C++ Functions - Pass By Reference

In this tutorial you can have to learn about C++ function- pass by reference, Passing argument by reference uses a different mechanism. Instead of a value being passed to the function, a reference to the original variable, in the calling program, is passed.

An important advantage of passing by reference is that the function can access the actual variables in the calling program.

 This provides a mechanism for passing more than one value from function back to the calling program.

Example :

Output :