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's the most powerful programming language?

598


What is null and void pointer?

597


What is the difference between interpreters and compilers?

629


What do you mean by a template?

623


What is type of 'this' pointer?

598






Write a C++ Program to check whether a number is prime number or not?

638


What is the difference between structure and class?

562


Are vectors faster than arrays?

569


Write a c program for binary addition of two 8 bit numbers.

3668


Can you write a function similar to printf()?

669


What is the basic difference between C and C++?

626


What is purpose of new operator?

599


What is the type of 'this' pointer? When does it get created?

552


By using c++ with an example describe linked list?

607


What language does google use?

589