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 |
write a program to find 2^n+1 ?
What does it mean when someone says I oop?
What does sksksk mean in text slang?
What is the fundamental idea of oop?
What is coupling in oops?
Why multiple inheritance is not allowed?
What is multidimensional array?
c++ program to swap the objects of two different classes
Define a class to represent a bank account. Include the following members: Data Members: Name of the Depositor Account Number Type of Account Balance amount in the account Member Functions: To assign the initial values. To deposit an account. To withdraw an amount after checking the balance. Write a C++ main program to display account number, name and balance.
who is the founder of c++?
what is costructor?
design class for linked list and include constructor,destructor,insert option. struct node { int node; struct node &ptr; }