A Guide on how to setup VScode and Code Runner for C++ 17 (Mac/Windows)
Step1. Download VScode and exteentions.
Download and install Vscode and from the microsoft website https://code.visualstudio.com/download.
Open VScode.
Download and install C++ Extensions for VScode.
Download and install Code Runner Extension.
Step 2. Set up Code Runner with C++17 flag
Go to Code / Prefrences / Settings then Select Extensions -> Run Code Configure -> Executor Map
Add the following command to run for cpp file in the Executor map.
1 2 3
"code-runner.executorMap": { "cpp": "cd $dir && g++ -std=c++17 -g $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt" }
Now create a test file test.cpp and run the file using Code Runner Play button. You can see the excuted Command and Outuput in the terminal Window.
Similarly you can set up which commands to execute for different languages. Here is a link to a blog to help you with it.