I was learning about C++ pointers and the ->
operator seemed strange to me. Instead of
ptr->hello();
one could write (*ptr).hello();
because it also seems to work, so I thought the former is just a more convenient way.
Is that the case or is there any difference?
See Question&Answers more detail:os