我们的作业哇,哎,用了一下午,就因为%d和%s,哎,写习惯了,最后发现是这个原因号崩溃的。。
本人菜鸟一枚,刚学数据结构,希望大神指点。
代码如下:
#include
#include
#include
#include
#include
#include
#define MAXSIZE 30
#define LIST_INIT_SIZE 100
//线性表存储空间的初始分配量
#define LISTINCREMENT 10
//线性表存储空间的分配增
#define TRUE
1
#define FALSE
0
#define OK
1
#define ERROR 0
#define OVERFLOW
-1
typedef int Status;
typedef struct ElemType{//定义一个结构体包含学院名和电话
char data[20];
char dianhua[20];
}ElemType;
//顺序表定义
typedef
struct
{
ElemType *elem;
//存储空间基址,体现动态性
int
length;
//当前表的长度
int
listsize;
//当前分配的存储容量