Why static Function is used in C++?

Answers were Sorted based on User's Feedback



Why static Function is used in C++?..

Answer / sujai cn

Static functions are used to perform the tasks which are
independent of the state of object or to perform class wide
functions ex. to count the number of instaces (objects) are
there in existence.

Is This Answer Correct ?    14 Yes 1 No

Why static Function is used in C++?..

Answer / rafiuddin

static functions can be called with out the class object
also. we can call static functions with scope resulation
operator.

Is This Answer Correct ?    9 Yes 1 No

Why static Function is used in C++?..

Answer / mugdha taru

Because it is the only function which is accessible even
when class is not instantiateed

Is This Answer Correct ?    6 Yes 3 No

Why static Function is used in C++?..

Answer / mugdha taru

Because it is the only function which is accessible even
when class is not instantiateed

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More OOPS Interview Questions

Explain the concept of abstracion and encapsulation with one example. What is the difference between them?

3 Answers   PCS,


explain sub-type and sub class? atleast u have differ it into 4 points?

0 Answers   Infosys,


What is constructor in oop?

0 Answers  


Why a "operator=(...)" when there is a copy ctor?

2 Answers  


diff between Virtual mathod and abstract method?

1 Answers  






Name a typical usage of polymorphism

3 Answers  


What is persistence in oop?

0 Answers  


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

0 Answers  


Why do we use virtual functions?

4 Answers  


20% of a 6 litre solution and 60% of 4 litre solution are mixed what the % of mixture of solution it is resulted into?

5 Answers   IonIdea,


WHY FUCTION OVERLOADING DOSENOT RETURN A RETEN TYPE

2 Answers  


write a program to find 2^n+1 ?

0 Answers   CTS,


Categories