The automatic variable is temporary, because it loses its value upon the exit from the block. The domain of the variable is the block, where it is defined. Variables defined inside the block take precedence over the variables defined in the enclosing blocks. Example:
void func(char c)
{
int i = 0;
if (c == '0')
{
char i = 8;
i++;
}
i++;
}
The local variable can be described everywhere within the function, as in C++.
Values of non-initialized local variables are undefined.
The function formal parameters are processed the same way as local variables.
Static variables inside the function are not implemented.
|