what is static function

Answers were Sorted based on User's Feedback



what is static function..

Answer / anil bisht

Static member functions have a class scope and they do not
have access to the 'this' pointer of the class. When a
member is declared as static, a static member of class, it
has only one data for the entire class even though there are
many objects created for the class. The main usage of static
function is when the programmer wants to have a function
which is accessible even when the class is not instantiated.

Is This Answer Correct ?    19 Yes 0 No

what is static function..

Answer / aavesh yadav

Static functions are functions which can access only static
variables and local variables.It can be called by class
name bcoz it is specific for a class in which it is
defined,not for any specific object of that class.It can
not be inherited also.

Is This Answer Correct ?    7 Yes 4 No

Post New Answer

More C++ General Interview Questions

Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes

0 Answers  


write a program that takes 5 digit no and calculate 2 power that no and print it.

3 Answers  


Give 2 examples of a code optimization?

4 Answers  


Difference between shift left and shift right?

1 Answers   Symphony,


print first nodd numbers in descending order

7 Answers  






What is the this pointer?

0 Answers  


Define a constructor - what it is and how it might be called (2 methods)?

0 Answers  


What do manipulators do?

0 Answers  


What are built-in functions? What is the syntax for the definition?

0 Answers  


What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?

0 Answers  


What is general format for a prototype?

0 Answers  


What is a syntax in c++?

0 Answers  


Categories