Windows Programming Tips
VCではfor文内で定義した変数のスコープがfor文の外部になります。
for ( int i = 0; i < 10; ++i ) { ... } if ( i == 10 ) { // 標準ではNG, VCではOK ... }