#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的更多相关文章

  1. 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 ...

  2. 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 如图所示: ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 【异常】‘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 ...

  7. ‘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 ...

  8. 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项换一行 ...

  9. 'for' loop initial declarations are only allo

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

随机推荐

  1. CentOS 6.3下搭建Web服务器

    准备前的工作: 1.修改selinux配置文件(/etc/sysconfig/selinux) 关闭防火墙 (1)把SELINUX=enforcing注释掉 (2)并添加SELINUX=disable ...

  2. php mongodb manager 查数据的各种姿势

    一.连接 mongodb 数据库 以下操作默认都是以上面操作为前提(已连接成功)而做的操作 二.查的各种姿势 1)通过主键_id来查询,注意:_id不是直接用字符串来表示,要用 new \MongoD ...

  3. postgres外部表之-oracle_fdw

    1. 安装Oracle客户端工具 编译安装oracle_fdw之前,需要安装Oracle的客户端程序:步骤略 下载地址:http://www.oracle.com/technetwork/databa ...

  4. Linux误删文件后恢复数据

    在Linux下,基于开源的数据恢复工具有很多,常见的有debugfs.R-Linux.ext3grep.extundelete等,比较常用的有ext3grep和extundelete,这两个工具的恢复 ...

  5. 微信公众号access_token的获取与存储

    如果是一个用户触发,那么只要将access_token放在数据库,文件,nosql就行,取时判断时间是否过期,过期重新去微信获取再放入. 如果是很多用户,多进程并发,特别是分布式那种架构呢?进程A判断 ...

  6. php计算两个日期时间差(返回年、月、日)

    在PHP程序中,很多时候都会遇到处理时间的问题,比如:判断用户在线了多长时间,共登录了多少天,两个帖子发布的时间差或者是不同操作之间的日志记录等等.在文章中,简单地举例介绍了PHP中如何计算两个日期相 ...

  7. Unicode编码转换汉字

    Uri.UnescapeDataString(string) #region Unicode转换汉字 Console.WriteLine(Uri.UnescapeDataString("\u ...

  8. WebService连接postgresql( 失败尝试)

     一.先进行postgresql的配置 1. 安装ODBC驱动 下载地址:http://www.postgresql.org/ftp/odbc/versions/msi/ 2. 打开 控制面板 -&g ...

  9. 某MDU产品OMCI软件升级加速方案

    说明 本文基于某GPON MDU产品的当前情况,提出OMCI升级的加速方案. 因时间仓促和水平限制,文中难免存在错漏和不足之处,敬请指正. 一  问题提出 根据G.988标准相关描述,软件升级过程可分 ...

  10. 【Python3】 PyV8的安装与使用

    centos7  python3.6.4 1 安装boost  :  PyV8 依赖于Boost yum install boost yum install boost-devel yum insta ...