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

Who invented oop?

843


what are the ways in which a constructors can be called?

1804


What is abstract class in oop?

750


to find out the minimum of two integer number of two different classes using friend function

1872


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1745


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

2063


What is oops and its features?

832


Can we create object of abstract class?

828


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

1987


Why is encapsulation used?

772


What is the renewal class?

2414


What are two types of polymorphism?

805


What is object and example?

881


Why do we need polymorphism in c#?

885


What is the point of polymorphism?

775