try using -o option.

本區專門提供 Mac OS X 使用者交換使用心得

版主: ross_ttbryanchangdigdogchester

回覆文章
內容
發表人
macman2002
新生訓練中
文章: 10
註冊時間: 02/03/2002 1:01 am
來自: USA/NY

try using -o option.

#1 文章 macman2002 »

hi, the cc compiler usually compile the file and build a executable file named a.out in the same folder as you source file. So under the same folder as your source file, type ./a.out then you see the program.
You'd bette using the -o option with the cc complier which means when you compile c file, you type cc -o "anyfile name you want, example: hello" filename.c. So you just type ./hello to run your program.
回覆文章