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
Show the application of a dynamic array with the help of an example.
What is constructor c++?
Explain what data encapsulation is in c++?
What is binary search in c++?
Explain linked list using c++ with an example?
Keyword mean in declaration?
Which c++ operator cannot overload?
Define Virtual function in C++.
Is c++ vector a linked list?
What are friend functions in C++?
What is else if syntax?
What is the equivalent of Pascal's Real a) unsigned int b) float c) char
What is iterator c++?
What is a stack? How it can be implemented?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.