以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转存到链表的各个结点中,请填空。
#include <stdlib.h>
stuct node
char data; struet node * next; ;
stntct node * CreatList(char * s)
struet node *h,*p,*q;
h = (struct node * ) malloc(sizeof(struct node) );
p=q=h;
while( * s! =’\0’)
p = (struct node *) malloc ( sizeof(struct node) );
p - > data = ( )
q- >next=p;
q=p;
a++;
p- > next =’\0’;
return h;
main( )
char str[ ]= "link list";
struet node * head;
head = CreatList(str);
A.*s
B.s
C.*s++
D.(*s)++