数据结构 C语言问题 高手来!

来源:百度知道 编辑:UC知道 时间:2024/07/05 02:45:23
请高手给看一下,这是对线性表插入删除以及合并的代码,有一处错误,老师也没找到!希望高手帮忙找下!
#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
#define LIST_INIT_SIZE 10
#define LISTINCREMENT 2
#define OVERFLOW -2
#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);
Status ListInsert_Sq(Sqlist &L,int i,ElemType e);
Status MergeList_Sq(SqList La,SqList Lb,SqList* Lc); //合并
Status ListPrint_Sq(SqList* L);
/////////////////////////////////
int main()
{
Sqlist La,Lb,Lc;
int i=1;
ElemType num=0;
InitList_Sq(&La);
InitList_Sq(&Lb);

printf("Please input the number(end by -1):\n");
while(1)
{
scanf("%d",&num);
if(num==-1)
break;
ListInsert_Sq

一处错误吗?
N处吧..
typedef struct 里的struct 都写成大写,能编译通过不?
定义的是Sqlist,后面却用SqList,能通过不?
形参和实参传的都不是一种类型,能通过不/?
好好改了再说吧.

#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
#define LIST_INIT_SIZE 10
#define LISTINCREMENT 2
#define OVERFLOW -2
#define OK 1
#define ERROR 0
///////////////////////////////
typedef int Status;
typedef int ElemType;

struct SqList{
ElemType *elem;
int length;
int listsize;
};

Status InitList_Sq(SqList *L);
Status ListInsert_Sq(SqList *L,int i,ElemType e);
Status MergeList_Sq(SqList La,SqList Lb,SqList* Lc); //合并
Status ListPrint_Sq(SqList* L);
/////////////////////////////////
int main()
{
SqList La,Lb,Lc;
int i=1;
ElemType num=0;
InitList_Sq(&La);
InitList_Sq(&Lb);

printf("Please input the number(end by -1):\n");
while(1)