Okay
I have written two simple programs, helloworld.c and merrychristmas.c
Both compiled and executed okay, but my question is that in my documents folder I have both programs, but one a.out.
So when I first did helloworld, I typed ./a.out then my program executed and said hello world.
Then I compiled my second program (merrychristmas) and I typed ./a.out and it executed.
My question/dilemma is when I type ./a.out, it seems to be executing my most recent program. if I recompile, I guess that's what I'm doing when I type gcc ~/Documents/merrychristmas.c then it will execute the program I'm recompiling.
Do I need to re-compile as I showed in the above example every time to run the program I choose?
Or is there another way to run the program within terminal, without entering gcc again?
Thanks, and Merry Christmas to everybody out there!!
I have written two simple programs, helloworld.c and merrychristmas.c
Both compiled and executed okay, but my question is that in my documents folder I have both programs, but one a.out.
So when I first did helloworld, I typed ./a.out then my program executed and said hello world.
Then I compiled my second program (merrychristmas) and I typed ./a.out and it executed.
My question/dilemma is when I type ./a.out, it seems to be executing my most recent program. if I recompile, I guess that's what I'm doing when I type gcc ~/Documents/merrychristmas.c then it will execute the program I'm recompiling.
Do I need to re-compile as I showed in the above example every time to run the program I choose?
Or is there another way to run the program within terminal, without entering gcc again?
Thanks, and Merry Christmas to everybody out there!!