#include <stdio.h>
int main(){
  for(int i=0;i<10;i++){
    printf("\n%d",i);
  }
  return 0;
}

linux 使用 gcc 进行编译时报

‘for’ loop initial declarations are only allowed in C99 mode

原因是要在 for() 外面 初始化 i 变量

#include <stdio.h>
int main(){

  int i = 0;
  for(i=0;i<10;i++){
  printf("\n%d",i);
}
  return 0;
}

编译通过

‘for’ loop initial declarations are only allowed in C99 mode的更多相关文章

  1. error: ‘for’ loop initial declarations are only allowed in C99 mode

    比如写出下面这段程序: for (int i = 0; i < n; ++i) do_something(); 然后用gcc编译,会报 ‘for’ loop initial declaratio ...

  2. 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 initia ...

  3. error: &#39;for&#39; loop initial declarations are only allowed in C99 mode

    error: 'for' loop initial declarations are only allowed in C99 mode 使用gcc编译代码是报出 error: 'for' loop i ...

  4. 【异常】‘for’ loop initial declarations are only allowed in C99 mode

    1 Python版本导致的异常 /root/Python-3.5.7/Modules/_pickle.c: In function ‘PyMemoTable_Copy’: /root/Python-3 ...

  5. Win下GCC报错 error: ‘for’ loop initial declarations are only allowed in C99 mode

    ##报错## 用GCC编译for循环会出现以下错误 error: 'for' loop initial declarations are only allowed in C99 mode 如图所示: ...

  6. for’ loop initial declarations are only allowed in C99 mode

    今天做南邮编程在线的编程题,编程首先计算Fibonacci数列1,1,2,3,5,8,13,21,......的前n项(n不超过40)存入一维整型数组f中,再按%12d的格式输出每项的值,每6项换一行 ...

  7. [Error] 'for' loop initial declarations are only allowed in C99 or C11 mode

    #include <stdio.h> #include <stdlib.h> #define LIST_INIT_SIZE 100 //线性表存储空间的初始分配量 #defin ...

  8. error: ‘for’ loop initial declarations are only allowed in

    使用gcc,出现如下错误: thread_join.c:7:5: error: 'for' loop initial declarations are only allowed in C99 mode ...

  9. 'for' loop initial declarations are only allo

    linux系统下的c编程与windows有所不同,如果你在用gcc编译代码的时候提示‘for’ loop initial declarations are only allowed in C99 mo ...

随机推荐

  1. Unity NGUI 创建简单的按钮

    Unity版本:4.5.1 NGUI版本:3.6.5 注意NGUI版本,网上的大部分教程都是2.x版本的,在步骤上面略有不同,此文适合初学者. 示例: 通过NGUI创建一个背景和按钮. 1.首先创建一 ...

  2. C++中的 new / delete

    new的3种形态: new operator , operator new , placement new 1.new operator: new操作符,像 + - * / && . ...

  3. BZOJ 1071 [SCOI2007]组队

    1071: [SCOI2007]组队 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 1330  Solved: 417[Submit][Status][ ...

  4. GitHub上线Trending功能,帮你轻松找到有潜力的开源项目

    转自:http://www.csdn.net/article/2013-08-14/2816574-Github-Trending-Open-Source-Project Github开源项目 摘要: ...

  5. HDU 5452 Minimum Cut

    链接:http://acm.hdu.edu.cn/showproblem.php?pid=5452题目大意: 给你一个图G,图中包含一颗生成树.要求只能删除生成树内的一条边,使得图不联通.问最小的删除 ...

  6. 数学(GCD,计数原理)HDU 5656 CA Loves GCD

    CA Loves GCD Accepts: 135 Submissions: 586 Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 2621 ...

  7. 【动态规划】【二分】【最长上升子序列】HDU 5773 The All-purpose Zero

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5773 题目大意: T组数据,n个数(n<=100000),求最长上升子序列长度(0可以替代任何 ...

  8. poj2406 Power Strings(kmp失配函数)

    Power Strings Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 39291 Accepted: 16315 Descr ...

  9. 什么是ARC

    arc就是自动引用计算.英文名Automatic Reference Counting.在一开始的IOS开发中,内存管理是需要手动的,对某个资源的引用,引用后就对其计算+1,当不再使用就-1,当计算为 ...

  10. 9个Java初始化和回收的面试题

    1.Java中是如何区分重载方法的? 通过重载方法的参数类型和顺序来进行区分的. 注意:若参数类型和顺序均相同时,不管参数名是否相同,编译器均会报错,提示方法已经被定义.且不能根据返回值类型来区分,如 ...