解决Dev-C++ [Error] ‘for‘ loop initial declarations are only allowed in C99 or C11 mode

简介: Dev-C++ [Error] ‘for‘ loop initial declarations are only allowed in C99 or C11 mode

在使用 Dev-C++ 编写 C 语言程序时出现:



[Error] ‘for’ loop initial declarations are only allowed in C99 or C11 mode


在 for 循环里声明变量只允许在 C99 或 C11 模式, 需要在工具(Tools)/ 编译选项(complier option)/代码生成下的语言标准选择C99。


结果如下:


目录
相关文章
C++ 编译错误 error: ‘cout‘ was not declared in this scope (摄氏度与华氏度的转换)
C++ 编译错误 error: ‘cout‘ was not declared in this scope (摄氏度与华氏度的转换)
C++ 编译错误 error: ‘cout‘ was not declared in this scope (摄氏度与华氏度的转换)
C++ --- error C2664: “LoadLibraryW”: 不能将参数 1 从“const char *”转换为“LPCWSTR”
C++ --- error C2664: “LoadLibraryW”: 不能将参数 1 从“const char *”转换为“LPCWSTR”
306 0
|
5月前
|
编译器 开发工具 C++
【Python】已解决error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build
【Python】已解决error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build
2426 0
|
4月前
|
测试技术 C++
【C++】解决googleTest报错error: SEH exception with code 0xc0000005 thrown in the test body.
【C++】解决googleTest报错error: SEH exception with code 0xc0000005 thrown in the test body.
108 1
|
4月前
|
JavaScript C++
【C++ visual studio】解决VS报错:error C2447: “{”: 缺少函数标题(是否是老式的形式表?)【亲测有效,无效捶我】
【C++ visual studio】解决VS报错:error C2447: “{”: 缺少函数标题(是否是老式的形式表?)【亲测有效,无效捶我】
169 0
|
6月前
|
Linux C++
经验分享:C++ error:‘syscall’ was not declared in this scope
经验分享:C++ error:‘syscall’ was not declared in this scope
241 3
|
Linux C++
【C++编译】C++ error:‘syscall’ was not declared in this scope
sys/syscall.h 内部表示,他封装了![[Pasted image 20220818151746.png]] 打开对应的 syscall.h 文件内部依旧没有 syscall()函数的声明。
104 0
|
编译器 C++ 计算机视觉
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools“
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools“
849 0
|
传感器 IDE 开发工具
排错实战 —— 解决 c++ 工程编译错: error C2059 'string' illegal token on right
排错实战 —— 解决 c++ 工程编译错: error C2059 'string' illegal token on right
|
Oracle 关系型数据库 MySQL
Error:QSqlDatabase: QMYSQL driver not loaded (Qt+C++ 找不到mysql的驱动)
Error:QSqlDatabase: QMYSQL driver not loaded (Qt+C++ 找不到mysql的驱动)
322 0
Error:QSqlDatabase: QMYSQL driver not loaded (Qt+C++ 找不到mysql的驱动)