what is a ststic variable and stiticfunction
briefly explain with exmple and in which case we use
Answers were Sorted based on User's Feedback
Answer / subhashish sen
When a variable is declared with static keyword,its called
as static variable,means it retains its value across
different function calls.Its basically used for counting no
of objects created for a class in C++ and its initialized to
0 by default.
When a function declared as static,its called as static
function.It can only operate on static variables.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / zubeir
Static variable is the one allocated statically, meaning
that, it is allocated once in the program space and exists
till the program space is deallocated (the close of the
application).
Note:- Some people get confused between stack allocation
and static allocaion. Both are different terms.
A static function is again the same concept with static
variable allocation, but here the allocation is not just a
variable but a function's 'activation frame'. The
activation frame, for now, consider the function's
information required by the compiler to execute the
function which is stored internally.
| Is This Answer Correct ? | 1 Yes | 5 No |
write a short note on Overloading of Binary Operator?
how to create thread in java?
17 Answers IBM, Infosys, Wipro,
Which is the parameter that is added to every non-static member function when it is called?
Can a destructor be called directly?
What makes a language oop?
What is abstraction in oops?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
What are the types of abstraction?
WHAT IS ABSTRUCT DATA TYPE ? PLEASE EXPLAIN IT.
What is difference between multiple inheritance and multilevel inheritance?
What is a class in oop?
What is coupling in oop?