Sign in to follow this  

What to use to access member functions

This topic is 4857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What sould be used to access member functions? With the objects themselves (ex. obj.function()) or with pointers? objPtr->function(). Which is more appropriate?

Share this post


Link to post
Share on other sites
If you have an regular ol' object use .

If you have a Pointer to an Object use ->


The only other option (I believe) would be (*object).method() if you were given a pointer, which is more comlicated, harder to read, more keystrokes not to mention pointless because you already have a perfectly good pointer. I suppose you could also do (&object)->method() given an object, but that's equally rediculous.

Share this post


Link to post
Share on other sites

This topic is 4857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this