I'll just jump straight to the questions, and say that's quite a path to take to enlightenment. It's nice to hear someone take passion in something out of curiosity and because somewhere they learned what (I think) everyone learns at some point in their life: you're a lot damn smarter than you have been led to believe. It just takes extraordinary circumstances to bring it out.
First, get XCode for your iBook. Apple should be offering an XCode that is compatible with PowerPC processors, if the latest version isn't PowerPC-compatble (I think it is, but...). You may need to sign up for a "Free" Developer's Account at http://developer.apple.com. It's no trouble, and will allow you to download XCode. Choose the version that is compatible with the version of OS X you're running. Install it. Along with a bunch of cool GUI tools (that you won't use at this moment), it also installs the necessary command-line compiler tools you need.
At any rate, let's see... you've gotten to the point where you type a program -- good. Take that same program you have, and save it into a text file. Save it as "program1.c" on your Desktop, in plain-text format (TextEdit has an option for this).
Then, launch the terminal, and type the following command verbatim:
...and press Enter.
That "compiles" your "source code" (the code you typed) into an "executable binary" program -- basically, "gcc" (the compiler) interpreted your code, line-for-line, and turned it into something the computer can understand. Now, you've got an executable program that will run on Mac OS X on the command line.
gcc -o program1 program1.c
I'll break that last command down, word-by-word, because that's the syntax you'll use most of the time to compile simple C programs...
"gcc" -- the compiler. In the terminal, whenever you type something at the command line, the first "word" you type is a program, or some binary built-in to the bash shell (that's the name of the Terminal program or environment you're using -- even the Terminal itself is just a program). Everything after that, separated by spaces, are "arguments" to the program to tell it to do something.
The next two arguments go together:
"-o program1" -- means, "Make the output of this program (the gcc program) into the executable "program1" instead of "a.out" (which is what you get if you omit the "-o [executable name]").
After that, we have this:
"program1.c" -- the "input" to the gcc program (compiler). Gotta tell the compiler which source code to compile, right?
So, altogether we have a terminal "statement" that would look something like this in English:
Almost every UNIX program (something typed in the Terminal) can take "arguments" after the program name to modify and/or specify the way in which the program runs and what it does.
gcc, please compile a program and make an executable called "program1" using my source code "program1.c"
After you run through all that, to run your program, type this:
And, you should see "Hello, world" printed on your screen.
The "./" in front of the executable name tells the Terminal to "execute" the program located in the current directory ("./") named "program1."
If you wanted to execute a program named "program1" in your "Music" folder that is located in your home folder, you would type:
The "~" is shorthand for "home folder", and the rest is self-explanatory: "home folder" -slash- "Music folder" -slash- "program1".