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 |
Name an advantage of linked list over array?
What are the advantages of inheritance?
26 Answers IBS, TCS,
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
Prepare me a program for the animation of train
What is memory leak and memory corruption?
what isthe difference between c structure and c++ class
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
what is the new version of oops
What is advantage of inheritance?
what is the difference between class to class type conversion and copy constructor ?
what are the uses of C++
function overridind means and simple program