
Definition:
A reference variable is a “reference” to another variable. Better definition: A reference variable is just another pointer variable which will take its own space in memory from here References are nothing but constant pointers in C++. A statementint &i = j;
will be converted by the compiler to int *const i = &j
. Again from here
Usage:
Declare a reference as such with the “&”:
When you change the value of the reference variable you also change the value of the original variable. For example