return reference of pointer

In what situation we want to return a reference to pointer instead of a pointer?
Non-const references allow you to change the value that is being referenced.
In your case, the value being referenced is a pointer, so it allows you to change
the pointer.
I see. Otherwise, only the copy of the pointer is returned from the function. Thanks.
closed account (S6k9GNh0)
From what I know, a reference is simply a covered pointer. Passing a pointer should be no heavier than passing a reference. Passing a reference to a pointer is similar to passing a pointer of a pointer.

I would probably keep things simple and pass by pointer or reference instead of pass by reference of a pointer or pointer of a pointer.

/ends confusing talk
Topic archived. No new replies allowed.