VSCode C/C++ File Input + Output (Code Runner) Three Way View from this video
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && ./$fileNameWithoutExt < input.txt > output.txt",
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && ./$fileNameWithoutExt < input.txt > output.txt"input.txt ← program reads from this
output.txt ← program writes to this (auto-created)
Both go in the same folder as your .c/.cpp file.
Run code (while focused on the .cpp file):
Ctrl + Option + N
Terminate code:
Ctrl + Option + M
Open output.txt to see all program output.