1 .
The operator cannot be written in the pointer.
2 foo->bar()
= (*foo).bar()
2 must be enclosed in parentheses, such as (*foo)
.
Since the .
operator has a higher priority than the *
operator,
*foo.bar()
is likely to cause compilation errors.
In addition, the .
operator cannot be overloaded
->
can be overloaded, so be careful when writing
© 2024 OneMinuteCode. All rights reserved.