От: | Юрий Жмеренецкий | ICQ 380412032 | |
Дата: | 19.08.09 22:29 | ||
Оценка: |
void foo()
А>{
А> int a = 5;
А> {
А> int a;
А> a = 3;
А> }
А> printf( "%d\n", a ); // выдаст естественно "5"
А>}
C:\temp>cl test.cpp /analyze
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.cpp
c:\temp\test.cpp(6) : warning C6246: Local declaration of 'a' hides declaration of the same name in outer scope. For addition al information, see previous declaration at line '4' of 'c:\temp\test.cpp': Lines: 4