C compile & runner for VSCode
Open VSCode app, and search "Flash Run C/C++" in VSCode MarketPlace, then click "Install".
click here and click install button.
You can download in this page. When you finished downloading, click ··· button on top of the MarketPlace window, then select "Install from VSIX", and browse the downloaded .VSIX file and open it.
Open any C/C++ file, and press ▶️ Flash Run C⚡️ button located at the tab bar. It will automatically compile and run your C/C++ code.
Select lines of codes to run, then right-click on it and click ⚡ Flash Run Selected Lines (Experimental).
This feature basically makes and run the temporary file which includes all the header files and pre-defined functions, and selected code lines inserted in the main() function.
- Right-click on anywhere of your C/C++ editor screen.
- Click
[C/C++ ⚡️] Run C/C++ with Input (Experimental). - Enter your stdin input and press
enter. Your code will be compiled & run instantly.
- Create
input.txtandoutput.txtfiles in the same directory as your C/C++ file. - Each line in
input.txtrepresents a separate test case input. - Each corresponding line in
output.txtshould contain the expected output for the same test case. - Open your source file in VS Code.
- Open the Command Palette (⇧⌘P or Ctrl+Shift+P) and run:
Flash Run C: Run All Test Cases - The extension will compile your program, execute each test case, and compare results.
- Pass/fail results will be shown for each test, and a summary will be displayed.
Open VSCode Settings, and search "flash run c" at the search bar. You can find various settings you can change.