C++

References

Declare a reference by writing the type, followed by the reference operator (&), followed by the reference name. References must be initialized at the time of creation. Example 1

int hisAge;

int &rAge = hisAge;

Example 2

CAT boots;

CAT &rCatRef = boots;

Back to Index