c语言程序 带头节点链表

时间:2012-12-08 14:31:45
【文件属性】:
文件名称:c语言程序 带头节点链表
文件大小:3KB
文件格式:TXT
更新时间:2012-12-08 14:31:45
c语言 带头节点链表 #include #define NULL 0 struct student { long num; struct student *next; }; /*struct student *creat() { struct student *head,*p,*q; long x; q=head=(struct student *)malloc (sizeof(struct student)); head->next=NULL; printf("\nplease input datds to the list:"); scanf("%ld",&x); while(x!=0) { p=(struct student *)malloc (sizeof(struct student)); p->num=x; p->next=NULL; q->next=p; q=p; scanf("%ld",&x); } return(head); } */

网友评论