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

Generally, in all C++ programs, texts are in white colour. Can we change the colour of the text(either input or output or both)? If so, help me out.

1 Answers  


where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?

2 Answers   Infosys, Microsoft,


what is runtime polymorphism? For the 5 marks.

3 Answers  


What is a friend function & its advantage?

2 Answers   TCS,


What are the access specifiers avaible in c++?

4 Answers  






why in java first invoke public static void main(String args[]) method????Why not public static void method1(String args[])??

1 Answers  


what is the new version of c++

1 Answers   Ignou, Pramata, Satyam,


who is the founder of c++?

15 Answers   Hexaware, ONGC,


what type of question are asked in thoughtworks pair programming round ?

0 Answers   Thought Works,


What are the benefits of interface?

0 Answers  


what is virtual function in c++

6 Answers  


What is oops in programming?

0 Answers  


Categories