Why static Function is used in C++?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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.
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 :( :-?
what is runtime polymorphism? For the 5 marks.
What is a friend function & its advantage?
What are the access specifiers avaible in c++?
why in java first invoke public static void main(String args[]) method????Why not public static void method1(String args[])??
what is the new version of c++
1 Answers Ignou, Pramata, Satyam,
who is the founder of c++?
what type of question are asked in thoughtworks pair programming round ?
What are the benefits of interface?
what is virtual function in c++
What is oops in programming?