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
write a c program that multiplies 3 martices

Define Multi File Program? While writing large programs we must divide programs up into modules. These would be separate source files and the main() function would be in one fi

Employ operator () instead of operator[]. While you have multiple subscripts, the cleanest way to do it is along with operator () instead of with operator[]. The reason is that

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

what is poiter

What is difference between require_once (), require(), include()? require() includes and evaluates a specific file, if file isn't found then it shows a Fatal Error. require_

Project Description: I will need a tutor that would help me out in Data Structure and learning Algorithm more at the mathematical/algorithmic level. The book is written by "by T

Q: however shouldn't I always use a printOn() method instead of a friend function? A: No. The usual cause people wish to always use a printOn() method instead of  a friend fu

find the c program to find area under the curvey=f(x)   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area;