列表的插入与删除 #define ERROR 0 #define OVERFLOW -2 typedef int Status; typedef int Elemtype; struct Lnode { Elemtype data; struct Lnode *next; }; typedef struct Lnode Lnode,*LinkList; LinkList createlist() { LinkList L,p,r;int n,i; L=(LinkList)malloc(sizeof(Lnode)); L->next=null; r=L; printf("input the length:"); scanf("%d",&n); for(i=1;idata); //p->next=L->next; //L->next=p; r->next=p; r=p; } r->next=null; return L; } void printlist(LinkList L) { LinkList p; p=L->next; while(p) { printf("->%d",p->data); p=p->next; } } main() { LinkList L; L=createlist(); printlist(L); } r->next=p; r=p; } r->next=null; return L; } void printlist(LinkList L) { LinkList p; p=L->next; while(p) { printf("->%d",p->data); p=p->next; } } main() { LinkList L; L=createlist(); printlist(L); }