What is the use of static functions?

Answer Posted / manu

Static member functions have external linkage. These
functions do not have this pointers. As a result,

They cannot access nonstatic class member data using
the member-selection operators (. or –>).

They cannot be declared as virtual.

They cannot have the same name as a nonstatic function
that has the same argument types.

They are useful as they donot have access to this pointer
and so they can be called even though the class is not
instantiated.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define virtual constructor.

613


What are virtual functions in c++?

657


How java is different from c and c++?

606


What is an iterator class in c++?

573


What is a constant reference?

591






What is the type of this pointer in c++?

605


Is nan a c++?

590


What it is and how it might be called (2 methods).

636


Does c++ cost money?

556


What are the various storage classes in C++?

627


Is c++ a software?

701


What is the use of setprecision in c++?

521


Why is c++ difficult?

585


What are c++ files?

547


What do nonglobal variables default to a) auto b) register c) static

621