Developing C programs on Mac OS X using Xcode 3.0

Having switched to a Mac a few months ago, I was interested in finding out how to program in C using the software available on my Mac. Xcode 3.0 does the job. If you want to write a C program, just follow along:

Open Xcode 3.0 and click File > New Project. Select the arrow next to “Command Line Utility” and choose Standard Tool. Give your project a name and a location in which to store all the files that Xcode will build for you.

Now select Window > Organizer. Next, you’ll want to open a finder window and browse for the location of the name of the project folder you created earlier. Drag and drop that folder into the Organizer window. You’ll notice that it shows up there.

Click the arrow next to the project folder to see the files inside this folder. Next, to access the main C file, you can double click the file main.c, or you can click on the bottom icon the furthest to the right to open the editor in the Organizer window.

The next thing you’ll want to do is click the Build button, the one with the hammer. Finally, click the Run button. There you have it: you’re first C program on a Mac.

Leave a Reply