C语言指针链表.docxVIP

  • 1
  • 0
  • 约2.64千字
  • 约 5页
  • 2021-01-11 发布于天津
  • 举报
*时间:2010年8月28日 17:19:49 *功能: C 语言实现单链表的建立、输入、插入、删除、查找元素并返回位置 */ #includestdio.h #includestdlib.h #includemalloc.h /*假设输入的数据为 3 个--我比较好操作 -_-*/ #define size 3 typedef struct List { int num; int shuju; struct List *next; }list; /* 头结点 */ list *setup_list(list *head) { printf(setup_list\n); head=malloc(sizeof(list)); if(head==NULL) { printf(setup fail\n); getch(); exit(0); } head-num=NULL; head-shuju=NULL; head-next=NULL; printf(setup success\n); return head; } /* 输入数据 */ void input(list *head,int num) { list *q=NULL; list *s=NULL; s=malloc(sizeof(list)); s-next=NULL; printf(input the %d data:,nu

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档