(computer science) A local variable that does not cease to exist upon termination of the block in which it can be accessed, but instead retains its most recent value until the next execution of this block.
| Sci-Tech Dictionary: static variable |
(computer science) A local variable that does not cease to exist upon termination of the block in which it can be accessed, but instead retains its most recent value until the next execution of this block.
| 5min Related Video: Static variable |
| Wikipedia: Static variable |
In computer programming, a static variable is a variable that has been allocated statically — whose lifetime extends across the entire run of the program. This is in contrast to the more ephemeral automatic variables, whose storage is allocated and deallocated on the call stack; and in contrast to objects whose storage is dynamically allocated.
In many programming languages, such as Pascal, all local variables are automatic and all global variables are allocated statically. In these languages, the term "static variable" is generally not used, since "local" and "global" suffice to cover all the possibilities.
In the C programming language and its descendants, the term static variable has at least three separate meanings, each related to the semantics of C's static keyword:
static" at the top level of a source file. Such variables are not visible outside the source file ("file scope"), unlike variables declared as "extern".static" are class variables (as opposed to instance variables).This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)
| Utility class | |
| Initialization on demand holder idiom | |
| Static memory allocation |
| What is a static variable mean? Read answer... | |
| How you change a static variable in c? Read answer... | |
| How do you create static variables in php? Read answer... |
| Can static variables be declared as volatile? | |
| When global and static variable allocated? | |
| How do you declare a static variable in applescript? |
Copyrights:
![]() | Sci-Tech Dictionary. McGraw-Hill Dictionary of Scientific and Technical Terms. Copyright © 2003, 1994, 1989, 1984, 1978, 1976, 1974 by McGraw-Hill Companies, Inc. All rights reserved. Read more | |
![]() | Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Static variable". Read more |
Mentioned in