|
-
Nov 20th, 2002, 12:04 AM
#1
Thread Starter
Stuck in the 80s
VC++ vs Borland C++
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?
-
Nov 20th, 2002, 12:12 AM
#2
Frenzied Member
Re: VC++ vs Borland C++
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?
Its possible... MSVC has a small bug in its for loop:
Code:
for(int i = 0; i < 10; ++i);
for(int i = 0; i < 20; ++i);
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).
Z.
-
Nov 20th, 2002, 02:02 AM
#3
Hyperactive Member
It is because VC6 sees that i have already been declared.
The below will work
Code:
for(int i = 0; i < 10; ++i);
for(i = 0; i < 20; ++i);
but it is a hassle to change, especially when you copy and paste working code from Borland C++ to VC6.
Maybe this problem is resolved in VC7 aka VC.Net.
-
Nov 20th, 2002, 03:20 AM
#4
Monday Morning Lunatic
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...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 20th, 2002, 05:54 AM
#5
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|