0

& operator

Hey friends I know if we have a code like this: int *a=&b; The value of a will be the address of b and & operator returns the address of a variable but what will be the operator performance in this code: int b; int &a=b;

17th Jul 2020, 4:44 PM
GHOST mHBr
GHOST mHBr - avatar
2 Answers
+ 16
GHOST mHBr This concept is introduced in C++, here a is called reference variable . A reference variable provides an alternative name for previously defined variable In your code - int b; int &a = b; a is a reference variable which contain reference of b. {In short, a is just another name of b}
17th Jul 2020, 5:51 PM
Vinesh Wadhwani
Vinesh Wadhwani - avatar
+ 1
Thank you everyone I understood completly🙏🙏
17th Jul 2020, 6:48 PM
GHOST mHBr
GHOST mHBr - avatar