vscode 中的 c 如何支持 c99 中的变长数组?
vscode吧
全部回复
仅看楼主
level 1
代码
```
int n;
scanf("%d", &n);
int a[lbk]n[rbk];
```
编译器用的 mingw64 14, 编译可以通过且可以正常执行功能.
但是在编辑器是 n 处总有个红色波折线提示"表达式必须含有常量值". 数组名 a 也没法享受代码补全.
试过在设置 "C_Cpp:Default" 中添加 "-std=c99"
也试过在 settings json 中添加 "C_Cpp.default.cStandard": "c99",
都不行
请问怎么办
2025年01月14日 00点01分 1
level 1
贴吧把两个中括号转换成了四个中括号是什么鬼
[]
2025年01月14日 00点01分 2
level 1
解决了, 在 .vscode 文件夹内修改 c_cpp_properties.json文件
{ "configurations": [ { "name": "Win32", "includePath": [ "C:/mingw64/include" ], "compilerPath": "C:/mingw64/bin/gcc.exe", "cStandard": "c17", "cppStandard": "c++23", "intelliSenseMode": "gcc-x64" } ], "version": 4}
2025年01月22日 07点01分 4
1