Help - Hello World

catfish

Registered
I am trying to write hello world, but Apple's intro to the project builder is too complicated for me to do anything but follow right now. I have a book on C, and I just want to go through the book, but I need a compiler and an interface. I have used the gcc compiler, but I don't know how to use the output file... The Terminal Window won't execute it.

Anybody have any ideas for someone to begin writing code and focus more on learning the language than learning the IDE.
 
Actually, I would recommend starting with the command line tools (as I currently am.) The reason that it won't run your output file is probably because ./ isn't in your path by default. In other words, if you want to execute a.out in the current directory, you will have to type "./a.out". If it still says you can't run it, do "chmod 755 a.out" which will make sure you have execute permission. If you want to tell the compiler another output filename, rather than renaming later, just use the form "cc infile -o outfile". This is your best bet for learning pure C without wading through Project Builder, and is very handy since you can code from any Internet computer if you've got SSH or telnet running. Ah, the joys of UNIX.
 
Back
Top