I'm using VSCode on a MacBook Air. I have installed GCC to compile C files. Basically, when I try to compile a file with the keyboard shortcut, it works perfectly: file.out is generated, but, when I try to compile it using the "Run Code" button, on top-right, the file still gets compiled, but I get generated a file with no extension (which still works, but I don't think I can include it in a .gitignore file)
I tried creating a tasks.json file (in .vscode), in which I specified that I want my file to have a ".out" extension, but, apparently, clicking the "Run Code" button just ignores it.
I have no clue.
You can add a file with no extension to gitignore, it will get picked up.
If you compile the file with
gcc file.c, the default output file isa.out, which is a relic of Unix (MacOS is a derivative of it).You can use
gcc file.c -o outputFileto set the name of the output file. In this case, the generated output file doesn't have an extension. If you add this command toargsfield in yourtasks.jsonfile, you can useRun and Debugtab on the left side to run the program this way.I am not sure about Code Runner, as I haven't used it.
Alternatively, you can compile and link your project with CMake.