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