consider the following C++ code snippet.
int x = 100;
int &xref = x;
int y = 200;
xref = y;
obviously, this is erroneous. But why? I am yet to find out. I was told by my friend that references are internally const pointers to the type they are referring to. So they cannot be made to point to any other object.
What other differences are between references and pointers?
Pointers need dereferencing. References don’t.