A Competitive Programming setup using VSCode for C++ users in Windows and Ubuntu with Debugging support.
Installation video for Windows on Youtube
Installation video for Ubuntu on Youtube
- VSCode ready to use out of the box (Only windows users need to correct MinGW installation path).
- Run
.\windows-reset.batin Windows or./ubuntu-reset.shin Ubuntu to reset theCurrentFolder. - All
.cppfiles automatically take input frominput.txtand output tooutput.txtin the same folder. No need for complicatedifdefs. - Leverage powerful features of VSCode:
- Step Through Debugging (Execute the code line by line, Hover over variables to get values)
- Debug Console (View any object i.e. map, set, vector or any complex object)
- Zen Mode (Utilize your screen to the fullest)
- Follow Steps 1-4 from Official VSCode Windows Prerequisites
- Check your MinGW installation
You are good to go!
- Follow Steps 1-2 from Official VSCode Linux Prerequisites
- Make sure g++ is installed
- Install
sudo apt-get update sudo apt-get install g++ sudo apt-get install gdb
- Check Installation
g++ --version gdb --version
You are good to go!
- Download this repository and extract folder
CP-VSCODE-SETUP. - Open VSCode. Click on
File->Open Folder->CP-VSCODE-SETUP - Open a Terminal by clicking on
Terminal->New Terminalor pressCtrl+` - You can always create a
CurrentFolder from terminal by- Windows
.\windows-reset.bat- Ubuntu
- Make the script executable (Only needed once)
chmod +x ubuntu-reset.sh
- Execute the script
./ubuntu-reset.sh
CurrentFolder at any time, you may run this command again.
Your MinGW package version may be different. In this case, you should update the gcc.exe, g++.exe and gdb.exe locations in the .vscode configuration files.
- You should write your code in the
CurrentFolder. - Press
F5to run any.cppfile. The file will automatically take input frominput.txtand write output tooutput.txt
Happy Coding!
Please create a Github Issue should you come across an Issue or have a suggestion. I will be happy to resolve it at the earliest.
