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 is the history of c++?

557


What are arrays c++?

612


What are containers in c++?

567


When should we use container classes instead of arrays?

583


Write a struct time where integer m, h, s are its members?

518






What is #include cmath?

661


What do you mean by friend class & friend function in c++?

620


What are structures and unions?

569


What is encapsulation in C++? Give an example.

588


What is a list c++?

570


Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).

617


What is a c++ map?

659


how to connect with oracle 9i with server in socket program in c/c++

1847


Does c++ have foreach?

525


What is the first name of c++?

565