What are the major differences between the two compilers? I'm running on an educational version of VC++ and am looking for a free compiler.
Will I have to change any code to be compatible, and if so, what?
Printable View
What are the major differences between the two compilers? I'm running on an educational version of VC++ and am looking for a free compiler.
Will I have to change any code to be compatible, and if so, what?
Its possible... MSVC has a small bug in its for loop:Quote:
Originally posted by The Hobo
What are the major differences between the two compilers? I'm running on an educational version of VC++ and am looking for a free compiler.
Will I have to change any code to be compatible, and if so, what?
The above wont compile on MSVC, because it declares i in the wrong scope (it shouldnt be visible outside of the for loop). Most other things should be the same, unless you are using some non-standard code(most compilers dont like a lot of template meta programming, for isntance).Code:for(int i = 0; i < 10; ++i);
for(int i = 0; i < 20; ++i);
Z.
It is because VC6 sees that i have already been declared.
The below will work
but it is a hassle to change, especially when you copy and paste working code from Borland C++ to VC6.Code:for(int i = 0; i < 10; ++i);
for(i = 0; i < 20; ++i);
Maybe this problem is resolved in VC7 aka VC.Net.
VC7 fixes it (it's not a bug as such, it's just not following the change in the standard quite quickly enough). As you can see, the change to the standard makes it more logical.
For free compilers, see if you can find a copy of GCC 3.2 that runs on Windows. Best compiler I've found so far...
Borland C++ is better handling templates than VC++6. But since VC++7 MS has overtaken Inprise again.
There are a few other differences, but the main issue is standards compatibilty.
Note that you have to activate a compiler switch in VC++7 to get the for-loop thing to work.