I understand that local variables (along with other things) are placed in the activation record . And the activation record must exist before the function starts execution. Consider the following function:
void f(void)
{
int i;
scanf("%d", &i);
if (i > 10) {
int j = 22;
}
}
Looking at this function, it seems that the variable j
may or may not exist, completely dependent on user input at runtime. In this case
- Will the variable be placed
j
in the activation record? - Is this implementation defined (in other words, will any compiler generate equivalent code
j
declared outside and above the if` block)? - ,
j
, ? , j
if
?
C11. .