PreviousNext

The C++ Reference Operator (&) on Parameters

C++ passes arguments by value; however, to override this and cause a member function argument to be passed by reference, apply the reference operator (&) to the parameter in the interface definition. Specify a reference parameter as follows:

[parameter_attribute,…] parameter_type &parameter

Using the reference operator on a parameter is the same as applying the reference pointer attribute ([ref]) to a pointer parameter.