单项选择题
(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.*s
B.s
C.*s++
D.(*s)++
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
下列叙述中正确的是
A.线性表是线性结构
B.栈与队列是非线性结构
C.线性链表是非线性结构
D.二叉树是线性结构
点击查看答案&解析
单项选择题
下列选项中不属于算法的特性的是
A.确定性
B.可行性
C.有输出
D.无穷性
点击查看答案&解析
相关试题
以下程序中函数f的功能是将n个字符串按由大...
有以下结构体说明和变量定义,如图所示,指...
设有如下定义 struct ss { char name...
有以下程序 main ( ) int x[] =...
已定义以下函数: fun (char* p2, ...