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
  • 32,274
  • 27
  • 118
  • 177

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
  • 193,181
  • 53
  • 473
  • 722