单项选择题
(48)~(50)以下程序的功能足:建立一个带有头结点的甲—向链表,并将存储在数组中的字符依次转存到链表的各个结点中,请从与下划线处号码对应的一组选项中选择出正确的选项。
#include <stdlib.h>
struct 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
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序 main () { int i=0,s=0; do{ if(i%2) {i++;continue; } i++; s+=i; while (i<7); printf ( %d n , s );
有以下程序
main ()
{ int i=0,s=0;
do{
if(i%2) {i++;continue; }
i++;
s+=i;
while (i<7);
printf ( "%d\n" , s );
点击查看答案&解析
单项选择题
有以下程序 main ( ) { char a,b,c,d; scanf ( %c, %c, %d, %d , &a, &b, &c, &d); printf( %c,%c,%c,%c n ,a,b,c,d);
有以下程序
main ( )
{ char a,b,c,d;
scanf ("%c, %c, %d, %d" , &a, &b, &c, &d);
printf("%c,%c,%c,%c\n",a,b,c,d);
点击查看答案&解析
相关试题
以下程序中函数f的功能是将n个字符串按由大...
有以下结构体说明和变量定义,如图所示,指...
设有如下定义 struct ss { char name...
有以下程序 main ( ) int x[] =...
已定义以下函数: fun (char* p2, ...