When we are compiling a C program the output is stored in a.out. How can we redirect the compiled output to another file?
If foo will be your executable and bar.c is your source file then the command is:
foo
bar.c
gcc -o foo bar.c