close
We can use reference as alias of a variable ,
for example :
int a;
int& b = a;
b is as the same as a , we can imaging that a is a name for a memory space ,
besides , b is also a name for this memeory space ,
so the address of a and b are the same.
A reference is the object. It is not a pointer to the object, nor a copy of the object. It is the object.
(ref : http://www.parashift.com/c++-faq-lite/references.html )
全站熱搜