Visual Studio Compiler Configuration Options
I have recently inherited an old c++ project built in visual studio 2003 that consists of a lot of code that looks like this:
for(int i=7;i<40;i++)
title[i-7]=temp_title[i];
for(i=33;i<80;i++)
title[i] = ' ';
However, since I do not have VS2003, I installed 2008 and now I am running into a lot of compilation errors due to i being an undeclared identifier since its out of scope. I am a complete novice to visual studio, how do I configure my project so开发者_如何学Python it uses whatever compatible c++ compiler for 2003 so I can build the project and see what the heck its supposed to do.
@Kirill V. Lyadvinsky
Yes, I do plan to fix the code, however, I'd like to have a base version that I can use to test against in case I mess something up since the person who wrote this is now retired (thankfully)
You could use an option /Zc:forScope (Force Conformance in for Loop Scope). Switch it off as in the picture below. But I'd strongly recommend to fix the code so it will be conformant with current C++ Standard.
/Zc:forscope-
is what you seem to be looking for.
精彩评论