C++ Programmer Question:
Explain me what is meant by reference variable in C++?
Answer:
In C++, reference variable allows you create an alias (second name) for an already existing variable. A reference variable can be used to access (read/write) the original data. That means, both the variable and reference variable are attached to same memory location. In effect, if you change the value of a variable using reference variable, both will get changed (because both are attached to same memory location).
Previous Question | Next Question |
Tell us in how many ways we can initialize an int variable in C++? | Tell me what is abstraction? |