要在cmd中编译并运行
g ++ -std = c ++ 11 -O2 -Wall fileName.cpp -o fileName &&“ ./fileName”
对于VS code Terminal>配置任务
在 task.json
中 // See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "g++",
"args": [
"-Wall",
"-o",
"${fileBasenameNoExtension}",
"-g",
"${file}",
"&&",
"{file}"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}```
Thanks in Advance