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