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 function prototyping? What are its advantages?
what is Member Functions in Classes?
Explain shallow copy?
What is const pointer and const reference?
What is stream and its types in c++?
Explain deep copy?
Difference between class and structure.
How can a struct in c++ differs from a struct in c?
How many types of classes are there in c++?
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
What is anonymous object in c++?
Explain operator overloading.
How come you find out if a linked-list is a cycle or not?
What is #include iostream?
Describe linked list using C++ with an example.