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

Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)

0 Answers  


What do you mean by function and operator overloading in c++?

0 Answers  


What is a parameterized type?

1 Answers  


How do you clear a map in c++?

0 Answers  


what is the use of templates?

3 Answers  






Why do we need templates?

0 Answers  


How do I get good at c++ programming?

0 Answers  


What are the defining traits of an object-oriented language?

0 Answers  


How is computer programming useful in real life?

0 Answers  


Describe linked list using C++ with an example.

0 Answers  


What is the difference between public, private, and protected access?

0 Answers  


What is the difference between c++ and turbo c++?

0 Answers  


Categories