error: 'for' loop initial declarations are only allowed in C99 mode

error: 'for' loop initial declarations are only allowed in C99 mode

 

  出现错误:

error: 'for' loop initial declarations are only allowed in C99 mode

note: use option -std=c99 or -std=gun99 to comple your code

 

  原因:所采用的代码格式是C99规范,而当前解释器不符合。

  

  解决办法:

Settings

-> Compiler and debugger settings

-> Global compiler settings

-> Other options

-> 在编辑框中输入:-std=c99

-> OK 

posted @ 2017-09-29 16:08  瘋耔  阅读(531)  评论(0编辑  收藏  举报
跳至侧栏