return reference of pointer

Feb 7, 2010 at 4:22am
In what situation we want to return a reference to pointer instead of a pointer?
Feb 7, 2010 at 4:24am
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.
Feb 7, 2010 at 4:36am
I see. Otherwise, only the copy of the pointer is returned from the function. Thanks.
Feb 7, 2010 at 7:46am
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.