Determining C executable name

后端 未结 7 1005
心在旅途
心在旅途 2020-12-24 11:05

When we are compiling a C program the output is stored in a.out. How can we redirect the compiled output to another file?

7条回答
  •  感动是毒
    2020-12-24 11:26

    If foo will be your executable and bar.c is your source file then the command is:

    gcc -o foo bar.c
    

提交回复
热议问题