+2 votes
in Programming Languages by (11.1k 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

0 votes
by (15.8k points)

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

...