C++: Why do you need references when you have pointers? [duplicate]
Using pointers alone you can’t properly pass-by-reference or return-by-reference. Some methods require a reference. How would you implement a copy-constructor? Sometimes you need to enforce aliasing. You can’t do that with pointers – they can be changed. References cannot bind to something different. So when you initialize a reference, you guarantee it will refer to … Read more