Top
/
/
Answer-06E-6
Answer to Question 06E-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).