会提示在for循环里定义变量报错,可以使用如下方法解决
在.vscode的c_cpp_properties.json中修改cStandard版本为c99,如下所示:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c99",
"cppStandard": "gnu++98",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}