C++ on Mac?

Discussion in 'Mac Apps and Mac App Store' started by ChronoYu, Jul 28, 2008.

  1. ChronoYu macrumors member

    Joined:
    Dec 21, 2007
    #1
    Hi, I'm starting on a course in university for computer programming and so on, and I require the use of Microsoft Visual C++ on windows.
    Is there a version of this C++ program for Mac as well? And/or does Mac have it's own C++ program? Would it be the same as the one on Windows? As in, will there be any major differences that might cause problems when I compare what I have done in Windows and in class?
     
  2. richard.mac macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
    #2
    at Uni i study C and just use a text editor to write the code (i use TextWrangler) and use gcc in Terminal to compile the code i.e. gcc -ansi -pedantic foo.c

    im not sure about C++ but you should just be able to compile using gcc or use XCode which is on your Mac's install DVD
     
  3. eviltobz macrumors member

    Joined:
    Nov 12, 2007
    #3
    there are c++ compilers that will work on macs, in fact i'd be surprised if xcode diesn't have one built in which means that you'll already have it with you mac osx installation disc.

    the language of c++ itself should be the same across all different versions, however, the is actually very very little to c++ and much of what you do depends on the libraries being used. the common ones you tend to start using will probably be there stdio.h etc, but the point of microsoft visual programming languages is that they focus on using microsoft's libraries for windows, so as soon as you are doing anything with their specific stuff it won't be mac compatible anymore. bootcamp or parallels will be your friend here.
     
  4. Sander macrumors 6502

    Joined:
    Apr 24, 2008
    #4
    If it is an introductionary course to C++, it is unlikely that it will require MS Visual C++ (i.e., that it will use Microsoft-specific libraries). You will probably be able to do all your assignments just fine in Xcode using GCC to compile your C++ code.
     
  5. xlopez macrumors member

    Joined:
    Jul 13, 2006
    #5
    I took a C course last semester and even though it's pretty easy to write a command line tool and compile it through the terminal, the advantages Xcode provides make it a viable alternative. Once you open Xcode, you'll see how complicated it is and how it's just too much, but all you have to do is open a project and from the project manager screen look for "Command-line utility". THis will create a .cpp file and a "target file". Now you just write your code in the .c file, and hit cmd + r then shift + cmd + r and you get a shell like window of the program running. Now this is just for basic command line tools, but the advantage I was talking about is basically that the xcode text editor is pretty good, and you also get familiar with xcode for when you actually need a a program like that for more advanced stuff. Hope that helps(coming from a newbie).
     

Share This Page