list.h extern int insert(int val); extern int printf(); extern int new(); extern int del(); extern int destory(); list.c #include<stdlib.h> typedef struct node * Node; static Node head; struct node{ int val; Node next; }; int insert(int val){ Node p,q; p = head; if(p != NULL){ while(p->next != NULL){ p = p->next; } } q = (Node)malloc(sizeof(struct node); if(p == NULL){ head == q; } q->val = val; q->next = NULL; if(p == NULL){ head = q; return 1; } p->next = q; return 1; } void printf(){ Node p; p = head; while(p != NULL){ printf("d",p->val); p = p->next; } } void destory(){ Node p; p = head; while(p != NULL){ Node q; q = p; p = p->next; free(q); } head = NULL; }