Top
/
Compound
/
Answer-09A-6
Answer to Question 09A-6
No. Shadowing is only allowed when the shadowing variable declaration is inside a smaller compound statement. So
int n = 5; { int n = 10; … }
is allowed by C++ (but not by the coding standards).