Answer Posted / v venkatesh
The differences between a static member function and non-
static member functions are as follows.
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.
The static member functions are not used very frequently in
programs. But nevertheless, they become useful whenever we
need to have functions which are accessible even when the
class is not instantiated.
| Is This Answer Correct ? | 70 Yes | 6 No |
Post New Answer View All Answers
Will the following program execute?
How new/delete differs from malloc()/free?
what Is DCS ? what i will get benefit when i did?
How do I make turbo c++ full screen?
Will c++ be replaced?
Is there any function that can skip certain number of characters present in the input stream?
What is the difference between a definition and a declaration?
Does std endl flush?
Difference between class and structure.
Can char be a number c++?
Why is swift so fast?
What is runtime errors c++?
What can I safely assume about the initial values of variables which are not explicitly initialized?
What is flush programming?
Is rust better than c++?