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
What's the order in which the objects in an array are destructed?
What is general format for a prototype?
Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort
What can I use instead of namespace std?
Why was c++ made?
In the derived class, which data member of the base class are visible?
What is the full form nasa?
Can notepad ++ run c++?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
Define namespace in c++?
Is overriding possible in c++?
Can char be a number c++?
What are the new features that iso/ansi c++ has added to original c++ specifications?
What are the various oops concepts in c++?
Explain differences between new() and delete()?