Intro
References
Setup
Install VS Code
sudo snap install code --classicInstall Extensions
- C/C++ (Microsoft)
- CMake Tools (optional)
Install Compiler
g++ --version
sudo apt install g++Project Structure
project/
βββ main.cpp
βββ my_computations.cpp
βββ my_computations.hppExample Files
Compile & Run
g++ main.cpp my_computations.cpp -o program
./programOutput
Double of 3 is 6
Quick Debug Setup
Create .vscode/launch.json:
launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Debug C++", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/program", "cwd": "${workspaceFolder}", "MIMode": "gdb" } ] }
Install GDB if needed:
sudo apt install gdbRun Debug: F5
Run Without Debugging: Ctrl + F5



