Call to a static member function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madshov
    New Member
    • Feb 2008
    • 20

    Call to a static member function

    Hi everyone,
    Is there an operator to call member functions of a class outside the class, without having to declare an instance of the object? Like the ::-operator i PHP (Hope I'm not offending anybody!)
  • scruggsy
    New Member
    • Mar 2007
    • 147

    #2
    Originally posted by madshov
    Hi everyone,
    Is there an operator to call member functions of a class outside the class, without having to declare an instance of the object? Like the ::-operator i PHP (Hope I'm not offending anybody!)
    Exactly like the :: operator in PHP:
    Code:
    class SomeClass {
    public:
      static void doStuff();
    };
    
    void someFunc() {
      SomeClass::doStuff();
    }

    Comment

    • madshov
      New Member
      • Feb 2008
      • 20

      #3
      Thanks for the answer!

      Comment

      Working...