C++ References

C++ References


C++ References :
A variable holding an address-of it what is “refers” to memory.
Must be refers to something
  • Must be initialize, can’ t be changed
  • More restricted to Java reference
Must be typed
  • Checked by compiler
  • Again can only refer to the type which it can point
The Syntax of C++ reference is as follows:
          string &Employee = empName;// can refer to string
Example :

Output :