+2 votes
in Programming Languages by (71.8k points)
When I compile my C code using gcc, it creates a.out as executable. How can I create excutable file with different name?

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

You need to specify the executable file name using "-o" option. See the below example.

gcc recur.c -o recur.out

It will generate executable file recur.out and then you can run it by typing:

 ./recur.out


...