Today, I took a crake at vs code and I've written a simple Cpp program.Here it is:
#include<iostream>
using namespace std;
int main(){
cout << "Hello World" << endl;
}
When I pressed F5 to compile and run, the cmd shell just flashed across...The means the program was terminated automatically... I hope that the shell would terminate only after I press any key to continue, just like compiled in Dev C++, what should I do?DO I need to add something in the tasks.json or the launch.json?
{//tasks.json
"version": "0.1.0",
"command": "g++",
"args": ["-g","${file}","-o","${file}.exe"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
{//launch.json
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
//"launchOptionType": "Local",
"targetArchitecture": "x86",
"program": "${file}.exe",
"miDebuggerPath":"d:\\C++\\Dev c++\\DevCpp\\32\\MinGW32\\bin\\gdb.exe",
"args": ["blackkitty", "1221", "# #"],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": true,
"preLaunchTask": "g++"
}
]
}