Hello, I had found a post on here a while back explaining how to know the difference between these two, but i can not seem to find it now. I think i remember what was explained but just wanted to double check it, could someone please correct me if my thoughts on it is wrong.
So from what I remember it is a reference if the & is on the left side of the = or if it follows a type name (before the variable name). ie - int &x
And it is a address if the & is on the right of the =
x = &y; //x must be a pointer, getting the address of y
type &x = y; //x is a reference to y.
you can deduce a rule of thumb from above about left and right, and it will be mostly true.
I am having trouble thinking up the examples where that can go wrong, but learning to read it will do you better than a rule of thumb in the long run.