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 )

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JerryCheng 的頭像
    JerryCheng

    KwCheng's blog

    JerryCheng 發表在 痞客邦 留言(0) 人氣()