Let we have declaration:
...
int a= 5;
int& b= a;
...
I dont understand, what difference between a
and b
. I think, that a
and b
is just adress. But where is this adress in memory? So, let we define a function:
int foo(int& x)
{
return x;
}
...
foo(a);
foo(b);
What is occuring when foo
is calling? I.e. when we'r returning a value we'r going by adress whos in a
or b
?