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 the difference between an external iterator and an internal iterator?
What do you mean by function and operator overloading in c++?
What is virtual methods?
What is the difference between a template and a macro?
What is class definition in c++ ?
Why do we use templates?
Is c or c++ more useful?
Write a program to find the reverse Fibonacci series starting from N.
What is the best book for c++ beginners?
Define vptr.
What do you mean by volatile and mutable keywords used in c++?
How a modifier is similar to mutator?
How do I make turbo c++ full screen?
What is a forward referencing and when should it be used?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?