以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转储到链表的各个结点中,请为下划线处有号码的选择出正确

分类: C语言开发工程师 发布时间: 2023-11-03 11:13 浏览量: 0

以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转储到链表的各个结点中,请为下划线处有号码的选择出正确的选项。
#include <stdlib.h>
Stuct node
{ char data; struct node *next;};
______ CreatList(char *s)
{ struct 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=___(49)___ ;
Q->next=p;
Q=______ ;
S++;
}
P->next='\0';
Return h;
}
Main()
{ char str[]="link list";
Struct node *head;
Head=CreatList(str);
...
}

A.*s

B.s

C.*s++

D.(*s)++

正确答案是A