![]() |
|
#1
|
|||
|
|||
Programming C with Xcode...plz helpok, I'm about 20 seconds from dropping this whole f**king C programming cuz I cant get it to work. I'm running on an ibook G4, Panther 10.3.8.
Now, I started with the simple "Hello, World" program (which i cant get to work). At first, I tried writing the program in the terminal itself which game me a syntax error whenever I wrote: "printf("hello, world\n);". I understood that I had to write the program in a text editor and save it as "hello.c". My questions are: #1 - In what text editor can I write this program #2- How in the WORLD do I compile it !!!!!!! #3- After compiling it, how do I run it in the terminal I installed Xcode and understood how to write a code for C, but after I save the code, what do i do???????????????? Sorry if i sound kinda pissed, but i really am determined to learn C but I had a sorta rough start. If you would be nice enough to give me somewhat of a step by step guide to accompish this "Hello World" drama going on in my life. I really appreciate your help and ur time, Sincerely, Mike |
|||
|
#2
|
||||
|
||||
|
Quote:
Quote:
Quote:
Quote:
__________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
|
#3
|
||||
|
||||
|
I never heard of Xcode before, but I ran a little search and it seems to be an all-in-one IDE (C, C++, Java - the works) for MacOS. I don't own a Mac, so I'll just give you a link Apple Malaysia.
It seems to have nice GUI. It even has a Build and Go button - that should build your program and run it. I'm sorry if you have a different version. Also, I have no idea on how to run it in the terminal. Maybe someone with a Mac... Kind regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#4
|
|||
|
|||
|
As mentioned you can use any text editor. I personally use emacs but that may be a little heavy for you as a beginner. Try using textedit.
To compile from the terminal gcc -o nameofoutput nameofinput.c and then to run the program type ./nameofoutput |
|
#5
|
||||
|
||||
|
I'm not physically near my Mac (being 1/2 way across the country from it) but from what I recall, after you've written your program, the "Build and Go" button should build, compile, and run your program. A new window will pop up w/ the output.
Once you've compiled the program, you be able to run it in Terminal like any other program; go to the directory you saved it in and execute the program. Alternatively, there should be an icon where you saved it that should run when you click it. XCode should give you a basic "Hello World" app when you first run it; if you compile this, you should have no problem. The "Help" menu has a great walkthrough for building apps in XCode; I was able to write a short program and get it running pretty quickly while having the Help window open next to my code. __________________
Start Programming with Python-A beginner's guide to programming and the Python language. ------------- Common Sense v2.0-Striving to make the world a little bit smarter. |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read/ Write EXCEL files using C/C++ programming | confused_pig | C++ Forum | 4 | 25-Nov-2005 01:27 |
| [Tutorial] GUI programming with FLTK | dsmith | FLTK Forum | 10 | 03-Oct-2005 16:41 |
| Graphics programming with TIFF file format | confused_pig | C Programming Language | 1 | 10-Jan-2005 08:53 |
| GUI programming | crystalattice | C++ Forum | 5 | 14-Sep-2004 13:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The