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

What is function overloading and operator overloading?

4 Answers  


can we make a class static without using static keyword?

5 Answers   Aspire,


What is encapsulation selenium?

0 Answers  


In multiple inheritance , to create sub class object , is there need to create objects for its superclasses??? in java and c++ both. Actually i have some information that is , all available members from its superclasses , memory created in subclass obj , so no need to create object for its superclasses...??? Thanks in Advance

1 Answers  


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

0 Answers   Infosys,


what is virtual destructor

7 Answers   L&T, TCS,


DIFFRENCE BETWEEN STRUCTURED PROGRAMING AND OBJCET ORIENTED PROGRAMING.

5 Answers  


how can we design a magic square in c++?or suggest me the basic idea of it.

3 Answers  


What is encapsulation with real life example?

0 Answers  


What is data binding?

4 Answers   Ittiam Systems,


How is class defined?

0 Answers  


WAP to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

1 Answers  


Categories