Chinaunix首页 | 论坛 | 博客
  • 博客访问: 324556
  • 博文数量: 65
  • 博客积分: 1770
  • 博客等级: 上尉
  • 技术积分: 1125
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-13 14:31
文章分类

全部博文(65)

文章存档

2016年(1)

2014年(2)

2013年(5)

2012年(18)

2011年(39)

分类: LINUX

2012-02-22 16:49:32

在linux下编辑test.c文件,保存退出
#include
#include
int main(){
        for ( int i = 0; i<= 100; i++ ) {
                printf("complete:%3d%%\r",i);
                fflush(stdout);
                sleep(1);
        }
}
[root@localhost ~]# gcc test.c -o test
test.c: In function ‘main’:
test.c:6: error: ‘for’ loop initial declaration used outside C99 mode
出现问题,上网搜了下,加参数-std=c99就没事了。
[root@localhost ~]# gcc test.c -o test -std=c99


参考网址:
阅读(1250) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~