code::blocks10.05让C代码使用C99标准

      使用code::blocks可以在64位windows7中完美进行C编程。

      使用过程中发现,编写如下for循环代码时,有报错:

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    for(int count = 1; count <= 10; count++)
      printf("%d\n", count);
    printf("Finished!\n");
    return 0;
}

      报错信息为:

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

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

      解决方法如下:

      Settings

-> Compiler and debugger settings

-> Global compiler settings

-> Other options

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

-> OK 

posted @ 2012-12-06 16:44  林燃  阅读(903)  评论(0编辑  收藏  举报