Is there a general difference between doing
As "jamesdlin" already noted, the
-> operators can be overloaded for class types.
And then the two expressions
ptr->method() can have different effect.
However, for the built-in operators the two expressions are equivalent.
-> operator is more convenient when you're following a chain of pointers, because
. has higher precedence than
*, thus requiring a lot of ungrokkable parentheses.