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 the difference between procedural programming and oops?

546


How do you achieve polymorphism?

607


What type of loop is a for loop?

680


What is property in oops?

561


Why is object oriented programming so hard?

610






String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

1936


c++ program to swap the objects of two different classes

1752


What is multilevel inheritance in oop?

547


What is basic concept of oop?

690


Where is pseudocode used?

560


write a programe to calculate the simple intrest and compund intrest using by function overlading

1659


How many human genes are polymorphic?

566


Why do we use oops?

585


What are the important components of cohesion?

548


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2000