What is difference between normal variable and reference variable in c++? tccicomputercoaching.com
A reference variable is an alias, that is, another name for an already existing variable in C++. Once a reference is initialized with avariable, either the variable name or the reference name may be used to refer to the variable.
They can be used like normal variables. ‘&’ operator is needed only at the time of declaration. Also, members of an
object reference can be accessed with dot operator (‘.’),
int amount =10;
now we do any update in amount variable , it will affect also in rupees variable. Same for vice versa.
amount=amount + 20;
To learn more about variable, data types , C++ Language , Operators.
Join TCCI in Bopal and Satellite in Ahmedabad.
You can Join TCCI online Coaching Class.
Call us@ 98256 18292
Visit us @ http://tccicomputercoaching.com/blog/