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

How to tokenize a string in c++?

775


What are the new features that iso/ansi c++ has added to original c++ specifications?

786


Is there any function that can skip certain number of characters present in the input stream?

777


What is c++ map?

750


Explain what is class definition in c++ ?

790






What are the vectors in c++?

757


Is c++ a programming language?

779


How const int *ourpointer differs from int const *ourpointer?

797


Can comments be longer than one line?

799


Does c++ have a hash table?

723


Can turbo c++ run c program?

809


What is std :: flush?

793


Differentiate between an inspector and a mutator ?

897


How do you differentiate between overloading the prefix and postfix increments?

785


Can you write a function similar to printf()?

852