- 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; }
1 Respuesta
0
what is your specific question?