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 is searching? Explain linear and binary search.
Is c++ still in demand?
How do you sort a sort function in c++ to sort in descending order?
Is c++ vector dynamic?
Explain the differences between list x; & list x();.
Give 10 points of differences between C & C++.
Explain the register storage classes in c++.
What is public, protected, private in c++?
What is a linked list in c++?
What are the various operations performed on stack?
What is c++ vb?
What are static and dynamic type checking?
What is the difference between a template and a macro?
Why is main function important?
Is vector a class in c++?