티스토리 뷰

C++

Reference in C++

seoca 2018. 11. 6. 08:38



Reference in C++

  • the lvalue can only be assigned to Reference
  • Reference is alias which is another name of existing variable
  • Pointer has a different address but the Reference has the same address with the variable. 
  • Address of the variable does not need to be copied




Example code







Result




'C++' 카테고리의 다른 글

Constructor and Destructor in C++  (0) 2018.11.06
Encapsulation (getters and setters) in C++  (0) 2018.11.06
Class and Object in C++  (0) 2018.11.06
Dynamic Allocation in C++  (0) 2018.11.03
Function Overloading in C++ with example code  (0) 2018.11.03