Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run a C++ program in Xcode 4?

People also ask

Can you use C in Xcode?

XCode is compatible with C, C++ and Objective C as well as Swift. Objective C is based on C. You can execute any C program in XCode as long as it does not have any platform specific dependencies that would prevent it from running on an Apple device / computer.

How do I run something in Xcode?

To compile and run your program, click the run button in the top left corner of the window. When your program runs, XCode will open an output pane. You can see any output that your program generated in that pane.

What version of C does Xcode use?

Xcode 4.6. 2 uses the Clang C++ compiler frontend with LLVM as backend which is conform to the C++11 standart and uses libc++ as the standart library. Here you can finde a apple presentation about libc++. Show activity on this post.


  1. Launch XCode
    Step 1
  2. In the "Choose template" box, pick Mac OS X, then Command Line Tool. Press Next
    Step 2
  3. Give your project a name, select C++ as the type
    Step 3
  4. You should see a new project with main.cpp
    Step 4
  5. press the Run button
  6. At the bottom of the screen, under All Output you should see:

    Hello, World!
    Program ended with exit code: 0