下列creat函数功能是建立一个链表,链表每个结点的数据是从键盘上输入的一个字符,链表创建直到输入的字符为问号时结束,新结点总是加到末尾。请把下面5处横线处的答案粘贴在文本框中,并用#连接,如:空1答案#空2答案#空3答案#,注意:不要有多余的空格和标点符号,且所有字符都是英文状态。
struct list
{
char data;
struct list *next;
};
struct list *creat()
{
struct list *h,*p,*q;
char ch;
h=_________malloc(sizeof(___________));
p=q=h;
while((ch=getchar())!='?')
{
p=________malloc(sizeof(__________));
p->data=ch;
q->next=p;
q=p;
}
p->next='\0';
____________;
}