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
  2. Finding half the value
  3. Finding half the value explicitly
  4. Arguments must match
  5. Exchanging two values
Like us on Facebook:


OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher: Zebra0.com
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License
Last modified: May 18 2017 14:07:38.