"BlueDoze" <bl******@yahoo.com> wrote in message
news:a5**************************@posting.google.c om...
I want to know the difference between the following 3 methods of
calling a public function, which method is better and why
method 1:
myClass::myFunction();
method 2:
myClass myObject;
myObject.myFunction();
method 3:
myClass * pMyObject;
pMyObject->myFunction();
I know the difference between 2 and 3, but i'd like to know the
differences between 1 and the others
Method 1 would be used in 3 cases:
a) myFunction is a static function, being called from somewhere outside
myClass
b) it's a function of the base class, where it's being called from a derived
class of myClass
c) it's a member function being called from another function of myClass.
In the case of c) it's not necessary to prefix with myClass - in fact it
would be redundant and confusing.