阿摩線上測驗 登入

試題詳解

試卷:93年 - 2004年9月计算机等级考试— 二级—《C语言 》#13859 | 科目:计算机等级考试— 二级—《C语言 》

試卷資訊

試卷名稱:93年 - 2004年9月计算机等级考试— 二级—《C语言 》#13859

年份:93年

科目:计算机等级考试— 二级—《C语言 》

48.48~50.以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的  字符依次转储到链表的各个结点中,请从与下划线处号码对应的一组选若中选择出  正确的选项。  #include  stuct node  { char data; struct node *next;};  (48) 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= (50) ;  s++;  }  p->next='\0';  return h;  }  main()  { char str[]="link list";  struct node *head;  head=CreatList(str);  ...  }
(A)char *
(B)struct node
(C) struct node*
(D) char
正確答案:登入後查看