When I compile a .c
file using the cc
command, it creates an a.out
executable. I've noticed that it creates the a.out
file inside my current directory. Is there a way to make the a.out
file be created in the same directory as the .c
file wherever I happen to be on the system?
for example if my current path is ~/desktop
and I type in the command:
cc path/to/my/file/example.c
It creates the a.out
file in the ~/desktop
directory. I would like it to create the a.out
file in path/to/my/file/a.out