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 |
If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?
What is an advantage of polymorphism?
In what situation factory design patterns,DAO design patterns,singleton design patterns should be applied.?
What is and I oop mean?
1. Define a class.
what is the 3 types of system development life cycle
what is different between oops and c++
#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; a.x = 22; int c = a.x; int *b = new int; cout << c; return 0; } option: No output 0 22 -(11) Will not compile
What is memory leak and memory corruption?
What is the purpose of enum?
Tell us about yourself.
47 Answers ABB, Amazon, Fidelity, Flextronics, Franklin Templeton, HCL, Hexaware, IBM, Impetus, Infosys, Reliance, Rofous, Silgate, Sutherland, TCS, Thomson Reuters, Virtusa, Wipro,
What is balance factor?