Maybe I'm nitpicky, but isn't it a bit wrong (and slightly confusing) to say that you "return an object as a pointer"?
Too me, that doesn't really make sense.
What you do is "returning a pointer that points to the object".
The pointer itself is an object too, a very different object then the class object it (maybe) points to.
I think that remembering this makes the answer more obvious.
But again, I'm not even a native english speaker, so maybe I read too much into the grammar....
Show differencesHistory of post edits
#1Olof Hedman
Posted 07 January 2013 - 04:21 AM
Maybe I'm nitpicky, but isn't it a bit wrong (and slightly confusing) to say that you "return an object as a pointer"?
Too me, that doesn't really make sense.
What you do is "returning a pointer that points to the object".
The pointer itself is an object too, a very different object then the class object it (maybe) points to.
I think that remembering this makes the answer more obvious.