what does it mean to declare a member variable as a static, C/C++ Programming

b) The static keyword let a variable to maintain its value among distinct function calls.

If the value of a static variable alters while the variable has been accessed, variable keeps the new value. If the identical variable gets accessed again, it would be storing its most recent value. It is possible because, while the static variable is declared, the compiler employee a separate memory area to hold it. By doing this, while the value of the static variable gets altered, it is updated in the memory it is occupying. And since this memory is separate, the compiler can check its values even whilst its function exits.

 

Posted Date: 3/21/2013 7:37:25 AM | Location : United States







Related Discussions:- what does it mean to declare a member variable as a static, Assignment Help, Ask Question on what does it mean to declare a member variable as a static, Get Answer, Expert's Help, what does it mean to declare a member variable as a static Discussions

Write discussion on what does it mean to declare a member variable as a static
Your posts are moderated
Related Questions
In this Lab you will code 8086 assembler equivalents (Virgo) for common C control flow instructions. This will give you an appreciation for how control flow is implemented in assem

Virtual Functions The keyword virtual was previously used to resolve ambiguity for a class derived from two classes, both having a common ancestor. These classes are known as v

#questi An array of n numbers is given, where n is an even number. The maximum as well as minimum of these given numbers need to be determined. Which of the following is true about

Define Scope Rules of C program - Computer Programming? The fundamental rule of scope is that identifiers are accessible only within the block in which they are declared and th


Implement (a part of) electronic election Scenario where following political parties are participating in election: PPP, PML and PTI.  Create a class PollingStation where it stor

Problem: a) Give and Illustrate with the help of diagrams, four topologies for the Network Information System (NIS). b) Give methods for creating user accounts and groups.

Project Description: P2P media streaming browser (IE, Chrome, Firefox) plug-in needed that is compatible with Win Xp,7,8 that is Windows Firewall friendly Example like Swarm

Observe that our model of evaluation allows for combinations whose operators are compound expressions. (a) Use this observation to describe the behavior of the following procedu

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b