Home : C Language : Variables : Attributes
Any variable may have one of the following attributes:
const |
the variable may not be modified by the program, i.e. it is not allowed on the left-hand side of an assignment statement. |
volatile |
warns the compiler that the variable might be altered by some process external to the program. |
extern |
the variable is external, declared as a global variable in another file. |
static |
(on a global variable) makes the variable local to this file, i.e.
it cannot be referred to in another file using the |
(on a local variable) allocates permanent storage for the variable, i.e. it is only initialised once, and it preserves its value between function calls. |
|
auto |
(the default for local variables) means that temporary storage is allocated for the variable on the stack, and its value is lost when the function returns. |
register |
if possible, the compiler will store the variable in a processor register rather than on the stack. |