Zebra0.com

cppIntroduction to C++ Programming

Introduction to C++ Programming

Learn C++ in step-by-step lessons.

Functions with pass by reference

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.

  1. Addresses of variables Addresses of variables
    /cpp/videos/variable-addresses.mp4

  2. Finding half the value

  3. Finding half the value explicitly

  4. Arguments must match

  5. Exchanging two values

GlossaryGlossary for passbyref lesson
Full Glossary