上课教写的代码 ,总报错,不知道怎么改

#include
#include
#define OK 1
#define ERROR 0
typedef int Status;
typedef int ElemType;
typedef struct{
    ElemType *elem;
    int length;
    int listsize;


}SqList;

Status InitList_Sq(SqList &L){  //算法
    L.listsize=30;
    L.elem=(ElemType*)malloc(L.listsize*sizeof(ElemType));
    if(L.elem!=NULL) return OK;
    return ERROR;
    L.length=0;
}
//线性表的创建
void CreatList(SqList &L,int n){

    ElemType x;
    for(int i=0;i>x;
       L.elem[i]=x;  L.length++;
    }
}

void display(SqList L){
    for(int i=0;i" "<

img

vc6不支持struct里面写函数,要声明到结构体外面。

#include<iostream.h>
这个是什么?
其他没问题,你原来是哪里少个个分号,现在应该ok 了