+ 1
Is the reference variable address and the existing variable address is same or not, In C++.
2 ответов
+ 4
Reference variables are aliases for an existing variable, i.e. different names for the same variable. Hence, they both refer to the same memory address. You can do a quick check yourself.
int a = 39;
int& b = a;
std::cout << &a << " " << &b;