Content deleted Content added
m stub sort |
mNo edit summary |
||
Line 13:
Static locals in global functions can be thought of as global variables, because their value remains in memory for the life of the program. The only difference is that they are only accessible through one function. Static locals can also be declared in class-level functions in [[Object-oriented programming|object-oriented]] languages.
Stricter and more formal [[Object-oriented programming|object-oriented]] languages such as [[Java (programming language)|Java]] and [[C Sharp (programming language)|C#]], do not allow local variables to be declared static to a function.
Instead, "static" variables in these languages are scoped to the class.
|