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

What are the differences between the function prototype and the function defi-nition?

858


How many namespaces are there in c++?

796


What information can an exception contain?

928


Is c++ a float?

825


Differentiate between realloc() and free().

804


Can manipulators fall in love?

777


Can I make ios apps with c++?

790


How do I use turbo c++?

751


Is string an object in c++?

902


Is std :: string immutable?

791


What is friend class in c++ with example?

717


Why can templates only be implemented in the header file?

896


How a new element can be added or pushed in a stack?

816


What is lambda in c++?

917


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

876