今天终于配置好了vscode,写一个函数的时候发现不支持c99,我用的是mingw,如何让vscode支持c99(能支持从c11最好)?
只有c99版本以上的编译器才支持,因此需要指定编译器版本为c99;vscode需要在.vscode/tasks.json配置,没有这个文件运行>启动调试,再右键文件Build And Debug Active File就能够生成
{
"version": "2.0.0",
"inputs": [
{
"type": "promptString",
"id": "commitInfo",
"description": "输入commit信息",
"default": "default information"
}
],
"tasks": [
{
"label": "提交代码",
"type": "shell",
"command": "./push.sh",
"args": [
"${input:commitInfo}"//inputs中的id
],
"group": "test",
"presentation": {
},
"problemMatcher": []
}
]
}
现在gcc基本都支持c11以上版本,在task.json中给gcc加参数-std=c11或者-std=c99