views:

55

answers:

4

Hi,

I have just come to Mac world from Linux world and I love my way around in Mac environment. I want to write and practice simple C programs in mac and I was searching for the tools I require. Most (All) of the resources in the web ask me to use XCode as IDE to do programming in C on Mac. XCode, for my purpose seems to be an overkill. I am in no way interested in developing iPhone or Mac GUI application. All I want is

  1. enter C programs using a text editor,
  2. compile it ,
  3. and get the output in a Console.

How can I do it ?

Thanks.

A: 

Just use gcc.

swegi
These days you can use clang instead.
JulesLt
+1  A: 

the 3 steps you give are simply the answer already:

  1. use text editor of choice
  2. use eg Terminal and compile on command line (simply using gcc, or cmake/make or so for more complex programs)
  3. run program on console
stijn
thanks .. I will do it
lakshmanan
+1- Thats a Neat answer
Praveen S
A complex text editor - like emacs or TextMate - will support the ability to trigger compilation from within the editor itself. Also worth looking into clang/llvm (the new compiler that is shaping up to replace gcc on OS X) as there are some nice features (like the static analyser that produces an HTML report on your code when called from command line).
JulesLt
A: 

Your could also use XCode to compile simple command line tools.

Start XCode File -> New Project Mac OS X -> Application -> Command Line tool

XCode has a really nice syntax highlighting and code completition and gdb integrated.

patrickS
A: 

Follow on from PatrickS's answer - I didn't read the original question clearly, but personally - other than following a couple of ObjC tutorials - the only time I've used XCode is AS a C IDE.

The feedback on compile errors is neat (visually integrated into the IDE rather than having to match lines from the compiler output), and getting better (due to integration with the underlying clang project).

JulesLt