求帮忙解决C语言问题

来源:百度知道 编辑:UC知道 时间:2024/04/30 13:56:24
#define LIST_SIZE 100
#define LIST_ADD 10
typedef char Elemtype
typedef struct
{Elemtype *elem;
int length;
int listsize;
}Sqlist;
int InitList_Sq(Sqlist &L)
{
L.elem=(Elemtype*)malloc(LIST_SIZE*sizeof(Elemtype));
L.length=0;
L.listsize=LIST_SIZE;
return(1);
}
int DestroyList(Sqlist &L)
{
if(L==NULL)return(0);
free(L);L=NULL;
return 1;
}

if(L==NULL)
这一句就有错,L是一个结构体变量的引用,不能与NULL进行比较的.
我想你的本意应该是L.elem.

你想要解决什么?找错误?还是?