[Error] 'for' loop initial declarations are only allowed in C99 or C11 mode
#include <stdio.h>
#include <stdlib.h>
#define LIST_INIT_SIZE 100 //线性表存储空间的初始分配量
#define LISTINCREMENT 10 //线性表存储空间的分配增量(当存储空间不够时要用到)
typedef int ElemType; //数据元素的类型,假设是int型的
typedef struct {
ElemType *elem; //存储空间的基地址
int length; //当前线性表的长度
int listsize; //当前分配的存储容量
} SqList;
int main() {
SqList list;
InitList(list); int n = 10; //添加10个数字给线性表list
for (int i = 0; i < 10; i++) {
ListInsert(list, i+1, i+1);
}
//删除第5个
ElemType e;
ListDelete(list, 5, e);
printf("删除的元素是:%d\n", e); //在第2个位置插入一个元素-1
ListInsert(list, 2, -1); //输出线性表
for ( i = 0; i < 10; i++) {
printf("%d ", list.elem[i]);
}
//输出结果是:1 -1 2 3 4 6 7 8 9 10 system("pause");
}
[Error] 'for' loop initial declarations are only allowed in C99 or C11 mode的更多相关文章
- 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 ...
- 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 如图所示: ...
- 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
使用gcc,出现如下错误: thread_join.c:7:5: 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 使用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 ...
- ‘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 ...
- 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项换一行 ...
- 'for' loop initial declarations are only allo
linux系统下的c编程与windows有所不同,如果你在用gcc编译代码的时候提示‘for’ loop initial declarations are only allowed in C99 mo ...
随机推荐
- LabelTTF 设置字体时的问题
使用cc.LabelTTF:create(txt, fontname, fontsize); 字体没能显示出来, 这里使用的是系统字体, 比如我使用"微软雅黑", 作为font ...
- Python easyGUI 文件对比 覆盖保存
#在35-3的基础上进行优化,当用户点击ok按钮的时候,对打开的文件进行检查是否修改.# 如果修改过,则提示覆盖保存.放弃保存.另存为并实现相应的功能 1 import easygui as g im ...
- firefox 好用的插件
firefox一直是各位渗透测试必备的利器,这里整理了34款Firefox插件和几款Chrome的插件,其中包含渗透测试.信息收集.代理.加密解密等功能. Firefox插件 1:Firebug Fi ...
- C语言实现字符串IP与整数型IP的相互转换
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h&g ...
- Android井字游戏(二)游戏界面
图片与代码可见书配套官网下载 1 棋盘 1.1 先将游戏界面所需的图片放于“drawable-xxhdpi”文件夹中,后缀xxhdpi表示超高密度. 然后将图片封装到drawable中一个名为til ...
- Material Design系列第八篇——Creating Lists and Cards
Creating Lists and Cards //创建列表和卡片 To create complex lists and cards with material design styles in ...
- Qt编写机房安全作业预警系统
最近给一个朋友做了个项目,运行在一个日本大型企业中,大屏显示.机房安全作业预警系统工事主要是由监控系统和报警系统组成.其目的就是通过监控系统实时观察空压机房内的动态,通过报警系统确认空压机房在规定的时 ...
- 【大数据系列】hadoop单节点安装官方文档翻译
Hadoop: Setting up a Single Node Cluster. HADOOP:建立单节点集群 Purpose Prerequisites Supported Platforms R ...
- OAuth网络协议(转)
一.应用场景 为了理解OAuth的适用场合,让我举一个假设的例子. 有一个"云冲印"的网站,可以将用户储存在Google的照片,冲印出来.用户为了使用该服务,必须让"云冲 ...
- Ubuntu Releases 版本下载站
http://releases.ubuntu.com/