previous | start | next

## Reference Parameters

- The parameter variables we have looked at so far are called value parameters.
- Value parameters are separate variables from the ones in `main()` (or another calling function).
- Modification of value parameters does not affect the original value.
- A reference parameter does not create a new variable, but refer to an existing variable.
- Any change in a reference parameter is actually a change in the variable to which it refers.
- Reference parameters are indicated using an `&` between the parameter's type and name.

  >     void raise_salary(Employee& e, double by)
  >     {
  >        double new_salary = e.get_salary() * ( 1 + by / 100);
  >        e.set_salary(new_salary);
  >     }

previous | start | next