Why static functions always uses static variables?
Answers were Sorted based on User's Feedback
Answer / george from psg
static function is constant to all object. In the same way
static variable is constant to all so we use static variable
in static function
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / som shekhar
If you take in the context of the class, static member
functions cannot be called by the ordinary objects because
when normal object calls the function then address of the
object is passed is collected by "this" pointer and static
member function don't have "this" pointer.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / harsha
context,object are created in RAM. context is created
once.static methods implementaion , static varibles loads
into context only once.All those staic members avilable to
each other obviously.
| Is This Answer Correct ? | 2 Yes | 3 No |
What is the difference between pass by value,pass by pointer,pass by reference in the catch block in the exception handling in c++
what is the application of oops?
What is solid in oops?
what is oops
Finding of the 4 larger (bigger) numbers from the list like{1245,4587,2145,1163,29987,65783.....}
difference between class and object
10 Answers Chandan, IBM, Magic Soft,
What is variable example?
What is the example of polymorphism?
Can a destructor be called directly?
what is a ststic variable and stiticfunction briefly explain with exmple and in which case we use
Program to check whether a word is the first word of the sentence.
when to use 'mutable' keyword and when to use 'const cast' in c++