Lecture 2 - Slide 13 : 29 |
A reference in C++ is an alias
A reference is an alternative name for an object
int k = 3; double a = 5.0; double &d = a; void f(int &i, double &d); f(k,a);
A reference in C++ can be understood as a generalization of "call by reference parameters"
Thus, C++ references are not just related to parameter mechanisms - they represent a broader concept