0

All,

Anyone have any suggestions for completing the last line below:

public/private define a variable's scope.
int/char/double define a variable's type.
static/non-static define a variable's ____________.

I know what static variables are, I just can't think of a word or even 2 words to fill in the blank. (I'm building a symbol table and I need a pidgeon hole for the "static" keyword.)

Thanks,
-Bill

4
Contributors
4
Replies
44
Views
4 Years
Discussion Span
Last Post by deceptikon
0

storage
In formal terms, "static" is a storage-class specifier.

That doesn't uniquely define static though. There are other storage class specifiers, and data types in general can be described as partially defining a variable's storage attributes.

Unfortunately, persistence doesn't quite cut it either if we're talking about a language like C++ because the static keyword is overloaded to mean different things. At file scope, static would be better described as defining a variable's visibility. As a static class member, a better description might be to define a variable as shared between objects of the class. At function scope, persistence is an excellent choice of words.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.