Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stevento

macrumors 6502
Original poster
Dec 10, 2006
252
0
Los Angeles
thanks

if i have a file called hello.c then i enter gcc hello.c to compile it but i dont know what to enter to run the program..?
./ is linux but i dont know what it is here
 

sammich

macrumors 601
Sep 26, 2006
4,305
268
Sarcasmville.
If you simply compile with the command 'gcc hello.c' it will create a executable called 'a.out'. To run this enter this into terminal './a.out'

To create a more meaningful name for the exec, use this:

gcc hello.c -o hello (gcc <sourcefile.c> -o <desiredname>)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.