Quote:
> So what gets changed? The (value of the) object (named 'x')? Or does
> 'x' itself change? Also, would 'x' be considered an identifier?
"You have two distinct objects, both named ``x''. The first, which we
can call the outer x, is created by the definition ``int x = 3;''.
It has static storage duration, meaning that it exists for the
entire lifetime of your executing program. The second, the inner
x, is created by the definition ``int x = 25;''. It has automatic
storage duration, meaning that it exists only during the execution
of the block (compound statement) that contains its definition.
When the first and third printf calls are executed, only the outer
x exists. When the second printf call is executed, both objects
exist simultaneously, but only the inner one is visible, because
it hides the outer one.
The only thing these two objects have in common is that they both
have the same name and the same type. You could change the name
of the inner x to y, and the program would do exactly the same thing.
Yes, x is an identifier.
This kind of hiding is usually not a good idea, because it can cause
confusion. "