- A static member function can access only static member data, static member functions and data and functions outside the class. A non-static member function can access all of the above including the static data member.
- A static member function can be called, even when a class is not instantiated, a non-static member function can be called only after instantiating the class as an object.
- A static member function cannot be declared virtual, whereas a non-static member functions can be declared as virtual
- A static member function cannot have access to the 'this' pointer of the class.
Friday, November 13, 2009
Static Functions
Static data types can be accessed without instantiation of the class in C++. This is applicable for static functions also.
The differences between a static member function and non-static member functions are as follows.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment