I made a small program that tries to illustrate the difference between references and pointers. Hopefully this will help you see how the "cannot be made to refer to a different object" works:
int main() { int a = 10; int b = 20; int* p = &a; std::cout << a << ", " << b << ", " << *p << ". p points to a\n"; *p = 11; std::cout << a << ", " << b << ", " << *p << ". Changing p changes a\n"; a = 12; std::cout << a << ", " << b << ", " << *p << ". Changing a changes p\n"; p = &b; std::cout << a << ", " << b << ", " << *p << ". p points to b\n"; *p = 21; std::cout << a << ", " << b << ", " << *p << ". Changing p now changes b, but a is unchanged as p no longer points to it\n"; b = 22; std::cout << a << ", " << b << ", " << *p << ". Changing b changes p\n"; int& r = a; std::cout << a << ", " << b << ", " << r << ". r references a\n"; r = 13; std::cout << a << ", " << b << ", " << r << ". Changing r changes a\n"; a = 14; std::cout << a << ", " << b << ", " << r << ". Changing a changes r\n"; r = b; std::cout << a << ", " << b << ", " << r << ". The value of r is set to the value of b, but r still references a and thus a changes too\n"; b = 23; std::cout << a << ", " << b << ", " << r << ". Changing b does NOT change r\n"; r = 24; std::cout << a << ", " << b << ", " << r << ". Changing r only changes a\n"; }
10, 20, 10. p points to a 11, 20, 11. Changing p changes a 12, 20, 12. Changing a changes p 12, 20, 20. p points to b 12, 21, 21. Changing p now changes b, but a is unchanged as p no longer points to it 12, 22, 22. Changing b changes p 12, 22, 12. r references a 13, 22, 13. Changing r changes a 14, 22, 14. Changing a changes r 22, 22, 22. The value of r is set to the value of b, but r still references a and thus a changes too 22, 23, 22. Changing b does NOT change r 24, 23, 24. Changing r only changes a
The point here is that with the pointer you can do p = &b and refer to a different object. This is impossible with a reference.
aat the end of your first caseint& ref = a;,refmeans exactly the same thing asa. The first is equivalent toint a = 10; int b = 20; a = b;, the second toint a; int b; a = b; a = 10; b = 20;.