0

After a c program is compiled it is stored in ./a.out.

Is there any way in which I can change the file to any name I want?

Tim
  • 33,500

1 Answers1

3

Depends on the compiler. For the GCC family (gcc, g++, etc.), you can use the -o option. The following creates an executable name blah:

gcc foo.c -o blah
muru
  • 207,228