References make call-by-reference easier, since the caller does not have to use the & operator when passinng an object.
Like this:
MyObject ob;
void foo_ref(MyObject& o){ ...}
void foo_ptr(Myobject* o){ ...}
//call
foo_ref(ob);
foo_ptr(&ob);
Furthermore, they enable initializing pointers in a function:
MyObject* ob = nullptr;
MySubject* sub = nullptr;
void foo_init(MyObject *& o, MySubject *& s) {
o = new MyObject;
s = new MySubject;
}
//call
foo_init(ob, sub);
Without the reference to pointer this example would only work with a pointers to pointers, making the code look terrible, as you would have to derefernce each argument first
MyObject* ob = nullptr;
MySubject* sub = nullptr;
void foo_init(MyObject ** o, MySubject ** s) {
*o = new MyObject;
*s = new MySubject;
}
//call
foo_init(&ob, &sub);