about the linked list// | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

about the linked list//

struct node { int date; struct node *next; }; typedef struct node linknode; typedef linknode *linklist; linklist creatlink() { linklist head,tail,q; int x; head=tail=NULL; printf("请输入整数序列(以空格分隔,以0作为结束):\n"); scanf("%d",&x); while(x!=0) { q=(linklist)malloc(sizeof (linknode)); q->date=x; if(head==NULL) head=tail=q; else { tail->next=q; tail=q; } scanf("%d",&x); } if(tail!=NULL) tail=NULL;//can i change the tail->next=NULL to tail=NULL return head; }

22nd Nov 2017, 12:17 AM
juary
1 Answer
0
what is your specific question?
2nd Dec 2017, 7:07 AM
Daniel
Daniel - avatar