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 are the various oops concepts in c++?
Explain queue. How it can be implemented?
what is Loop function? What are different types of Loops?
How to implement is-a and has-a class relationships?
What does the ios::ate argument do?
What is the v-ptr?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
What is the best c++ compiler for windows 10?
Write a program using display() function which takes two arguments.
How do you declare a set in c++?
How many types of modularization are there in c++?
Can non-public members of another instance of the class be retrieved by the method of the same class?
What is the full form of stl in c++?
Can comments be nested?
Can we define a constructor as virtual in c++?