Learn C++ in step-by-step lessons.
Pass by reference means that instead of passing the value of a variable to a function, we pass the address of the variable as an argument. When a function receives the address of a variable it can change the value stored at that address.
Pass by reference is usually only used if we need to change the value of a variable.
Please study the material at each of the links below.
Addresses of variables- Finding half the value
- Finding half the value explicitly
- Arguments must match
- Exchanging two values
Glossary for passbyref lesson
Full Glossary