About The examples given in the lecture about References & Pointers. I understand that a pointer, even when it points to the memory address of another variable, it’s still variable which can be located in memory. If we perform something like the following:
int val1=2;
int *MyPointer=val1;
std::cout << "Pointer Address in memory: " << &MyPointer << std::endl;
with that, we would be printing out the location in memory of the pointer.
My question is what happens with the References, are those variables?
If I wanted to know the location in memory of a defined reference, how would I printed it to the console since doing the following only gets me the address of the variable being referenced:
int val1=2;
int &MyReference=val1;
std::cout << "Reference Address in memory???: " << &MyReference << std::endl;
If someone could clear this out for me I would really appreciate it.