tags:

views:

60

answers:

2

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 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)

+3  A: 

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.

image:200

Kirill V. Lyadvinsky
+1 for the picture.
Thomas Matthews
+1  A: 

/Zc:forscope- is what you seem to be looking for.

Jerry Coffin