Skip to content

Instantly share code, notes, and snippets.

@shettykaran21
Last active August 23, 2020 07:23
Show Gist options
  • Save shettykaran21/d409c4722cc77ce1ddde18749b7105bf to your computer and use it in GitHub Desktop.
Save shettykaran21/d409c4722cc77ce1ddde18749b7105bf to your computer and use it in GitHub Desktop.
C++ for Competitive Programming - WSL (VS Code)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Build and Debug C++",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build C++",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "Build and Run C++",
"type": "shell",
"command": "/usr/bin/g++",
"args": [
"-std=c++17",
"\"${relativeFile}\"",
"-o",
"test.out",
"&&",
"./test.out",
"<",
"input.txt",
">",
"output.txt",
"&&",
"rm",
"test.out"
],
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"type": "shell",
"label": "Build C++",
"command": "/usr/bin/g++",
"args": [
"-g",
"${relativeFile}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": ["$gcc"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment