Results 1 to 5 of 5

Thread: VC++ vs Borland C++

  1. #1

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    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?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  2. #2
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710

    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.

  3. #3
    Hyperactive Member
    Join Date
    Sep 2001
    Posts
    396
    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.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width