69,369
社区成员
发帖
与我相关
我的任务
分享
typedef struct Lnode
{
ElemType data;//ElemType 已定义为 int
struct Lnode *next;
}Lnode;
Lnode *create(ElemType a[],int length)
{
Lnode *head=(Lnode*)malloc(sizeof(Lnode)),*p; /** 是这里有问题吧 -- *p ? **/
head->next=NULL;
int i; //error C2143: syntax error : missing ';' before 'type'
printf("l=%d\n",length);
for(i=length-1;i>=0;i--) //error C2065:'i' : undeclared identifier
{
p=(Lnode*)malloc(sizeof(Lnode));
p->data=a[i];
p->next=head->next;
head->next=p;
}
return head;
}