Xcode is a application for Mac users when writing programs. There are multiple versions and other methods for using this application, but as far as I am aware, the best version will be version Xcode 4. It's a free download from the Apple App. Store.

Creating a Project

  • Start Xcode.
  • A window like the following, should appear. If not, click “File” > “New” > “New Project…”
  • Select the “Application” tab from the left, then select the “Command Line Tool” from the main window. Click “Next”.
  • Type in the Project Name, and select the language (c++) from the pull-down menu.
  • Click “Next”.
  • Choose a location for where your code will go and the click “Create”.
  • Open the “.cpp” file found on the left hand side of the window.
  • Some code will already be written for you. You will want to edit this code to look like the following (except fill it with code that will fill the requirements for the Lab).

Running Your Project

  • When you are ready to run the program, press the play-shaped button at the upper left hand side of the screen. The program you just wrote will then be built, and the output will appear in the lower right hand side of the window.
cs-142/xcode.txt · Last modified: 2015/01/07 08:52 by ryancha
Back to top
CC Attribution-Share Alike 4.0 International = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0