What is the difference between references and normal variable handles in C++?

后端 未结 8 819
一生所求
一生所求 2021-01-22 23:33

If C++, if I write:

int i = 0;
int& r = i;

then are i and r exactly equivalent?

8条回答
  •  星月不相逢
    2021-01-23 00:05

    The Reference is an alias of an object. i.e alternate name of an object. Read this article for more information - http://www.parashift.com/c++-faq-lite/references.html

提交回复
热议问题