单链表的实现:
typedef int datatype; #define maxsize 10 #include<stdio.h> typedef struct { datatype data[maxsize]; int last; }sequenlist; sequenlist *L; main() { int i; char j; printf("Please input the list's element\n"); for(i=0;L->data[i]!='\n';i++) scanf("%d",&(L->data[i])); L->last=i; printf("%d",L->last); printf("Do you want see the list (Y or N):"); scanf("%d",&j); if(j=='Y'||j=='y') { printf("The list have %d Element\n",L->last); for(i=0;j<L->last;i++) printf("data[%d]=%d ",i,L->data[i]); } }