我是純粹的新手,要寃c/c++. 剛裝了xcode 3.1 ,第一次用,打開新文件,寫了一個hello.cpp的幼兒園程序。卻不知道如何運行。
試著用terminal, 鎖入 gcc hello.cpp , it says: command no found.
os x 10.5.8 leopard, xcode 3.1
解决办法:
1. run xcode.
2. create a new project; choose "command line project", choose "c" in the "type" menu
3. save your project use the any name.
4. in the project material window, open the "***.c" under the "source" folder. double click.
5. "hello world" is already a default example that xcode presented. delete the content between "//insert code here" and the next "}"
6. write whatever you want.
7. click "build and run" to build and run.