C Language Logo
C语言二级在线二级在线
首页选择题程序题成为会员帮助其他科目

选择题

12. 以下函数建立带头结点的单向链表,并返回头结点地址。编号为(48)的空应填入什么? #include <stdlib.h> struct node { char data; struct node *next; }; ____(48)____ CreatList(char *s) { struct node *h, *p, *q; h = malloc(sizeof(struct node)); p = q = h; while (*s != '\0') { p = malloc(sizeof(struct node)); p->data = *s; q->next = p; q = p; s++; } p->next = NULL; return h; }

上一题下一题