Run_C++_in_VSCode
Run_C++_in_VSCode
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
./output.exe
{
"version": "2.0.0",
"tasks": [
{
"label": "Build and Run C++",
"type": "shell",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileDirname}/output.exe"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$gcc"],
"detail": "Compile and run C++"
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug C++",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/output.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
cd C:\Users\USER\Desktop\DUET\PF\Lab_5
3. Compile manually:
4. Run:
output.exe