what is a ststic variable and stiticfunction
briefly explain with exmple and in which case we use

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is encapsulation in oops?

786


What is class and object with example?

844


What is polymorphism what are the different types of polymorphism?

778


What is the difference between a constructor and a destructor?

885


What are the two different types of polymorphism?

919


What is an advantage of polymorphism?

845


What is this pointer in oop?

829


Is oop better than procedural?

795


What is oops?what is its use in software engineering?

785


Why interface is used?

778


Why do we need oop?

898


write a program to find 2 power of a 5digit number with out using big int and exponent ?

2157


Write a c++ program to display pass and fail for three student using static member function

3124


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1658


What is overloading and its types?

854