There are two ways to pass a parameter to a function in C++: passing by value and passing by reference. In short, if you pass a variable to a function by value, the function can't change the content of the variable after the function is finished but if the variable is passed by reference, it may be changed by the function after the function is finished.
The following teaching aid shows you what will exactly happen in the computer when you pass parameter by value and by reference.