References in C++ Example | C++ References Tutorial is today’s topic. References are somewhat similar to  pointers, but not identical; there is a difference between  References and  pointers. References declared a second name to the existing variable. And the symbol “&” is used to declare a variable reference. If we declare a variable reference, it can be accessed by either the name of the variable or reference name. It is effortless and easy to declare references as it is declared by a simple “&.”And can be accessed by a special ‘.’  operator.

References in C++

Till now, we’ve discussed two basic variable types:

  1. Normal variables, which hold values directly.
  2. Pointer variables, which hold the address of another value (or null) and can be dereferenced to retrieve the value at that address they point to.

References are actually the third basic type of variable that C++ supports. The reference is a type of C++ variable that acts as an alias to another object or value.

#c++ #references in c++ #reference

References in C++ Example | C++ References Tutorial
1.95 GEEK