Possible Duplicate:
ptr->hello(); /* VERSUS */ (*ptr).hello();
I am learning C++ and my question is if there is any difference between using the arrow operator (->
) or dereferencing the pointer *
for calling a function.
These two cases illustrate my question.
Class* pointer = new Class();
(*pointer).Function(); // case one
pointer->Function(); // case two
What is the difference?