A-A+
以下程序实现带有头结点的单链表的建立 链表中每个结点包含数据域data(字符型)和指针域ne
问题详情
以下程序实现带有头结点的单链表的建立,链表中每个结点包含数据域data(字符型)和指针域next,所建立链表的头指针由参数phd传回调用程序。在空格处填入正确内容。 include<stdio.h> include<stdlib, h> struct node { char data; struct node * next; }; void creatlist(【 】) { char ch; struct node * s, * r; * phd= malloc(sizeof (struct node)); r= * phd; ch=getchar(); while(ch !=@) { s = malloc(sizeof(struct node)); s->data=ch; r->next=s; r=s; ch= getchar(); }; r->next=【 】; } main () { struct node * head; head= NULL; creatlist(【 】) }
请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:struct node * *phdNULL&head
structnode**phdNULL&head