Why should I use an object instance to access member functions rather than class::staticFunction?
( or why not? )
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re allowed to use the object.function() notation for a static function, but I’d advise against it — it gives the misleading impression that the function is associated with the specific object, like with a non-static member function. Using the classname::function() syntax portrays the situation clearly and accurately.