‘for’ loop initial declarations are only allowed in C99 mode
#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的更多相关文章
- 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 ...
- 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 ...
- error: 'for' 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 ...
- 【异常】‘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 ...
- 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 如图所示: ...
- 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项换一行 ...
- [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 ...
- 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 ...
- 'for' loop initial declarations are only allo
linux系统下的c编程与windows有所不同,如果你在用gcc编译代码的时候提示‘for’ loop initial declarations are only allowed in C99 mo ...
随机推荐
- wikioi3363支线剧情(挖个坑,不会做。。。)
3363 支线剧情 题目描述 Description 宅男JYY非常喜欢玩RPG游戏,比如仙剑,轩辕剑等等.不过JYY喜欢的并不是战斗场景,而是类似电视剧一般的充满恩怨情仇的剧情.这些游戏往往都有很多 ...
- 服务器端打开office然后采用虚拟打印 转换成pdf
服务器端打开office然后采用虚拟打印 转换成pdf [WebMethod] public bool ConvertWordTOPDF(string WordPath) { bool ret=fal ...
- Implement Stack using Queues ——LeetCode
Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. po ...
- FZYZ-2071 A Simple Math Problem IX
P2071 -- A Simple Math Problem IX 时间限制:1000MS 内存限制:262144KB 状态:Accepted 标签: 数学问题-博弈论 ...
- Nodejs in Visual Studio Code 13.构建单页应用Scrat示例挖一挖
1.开始 Scrat作者说要搞个很碉堡的示例,果然就搞出来了,如果要学习并使用Scrat,可以从官方示例开始,简直太方便了. 2.Scrat示例 目录 component_modules : 公共组件 ...
- linux下安装python linux下一些常用的命令
注意 ubuntukylin-14.04.2-desktop-amd64 自带python2.7.6 这个说的比较详细 http://wenku.baidu.com/link?url=gaeFcQrc ...
- wcf系列学习5天速成——第三天 分布性事务的使用 有时间再验证下 不同库的操作
原文地址:http://www.cnblogs.com/huangxincheng/archive/2011/11/06/2238273.html 今天是速成的第三天,再分享一下WCF中比较常用的一种 ...
- nginx在mac下的安装与基本操作
1. 安装 brew install nginx(需要安装homebrew) 2. 执行 nginx 直接启动nginx服务 3. nginx -s reload/stop 4. 配置地址 sud ...
- 《Mathematical Olympiad——组合数学》——操作和游戏
这篇文章,我们开始对奥数中有关操作和游戏的问题进行分析和讨论,其实在信息学竞赛中涉及到的一些博弈问题(分析必胜策略)的问题(例如巴什博弈.尼姆博弈),本质上来讲,就是组合数学当中的组合游戏,并不是真正 ...
- THOMAS MASON--英国顶级衬衫面料品牌
欧尚时光 THOMAS MASON--英国顶级衬衫面料品牌 2014-01-26 欧尚时光 今天为大家介绍英国顶级衬衫面料厂商:THOMAS MASON(托马斯·梅森).THOMAS MAS ...