单项选择题
以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转存到链表的各个结点中,请为下划线处选择正确的选项。()
#include < stdlib. h >
stuct node
char data; struct node * next; ;
( ) CreatList(char * s)
struet node * h, * p, * q;
h = (struet node * ) ma]loc(sizeof(struct node) );
p=q=h;
while( * s! ='\0')
p = ( struct node * ) ma]loc ( sizeof( struct node) );
p- >data= *s; q- >next=p; q=p;
s++;
p- > next ='\0';
return h
main( )
char str[ ] = "link list";
struet node * head;
head = CreatList (str);
A. char *
B. struet node
C. struct node *
D. char
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
请读程序: #include <stdio.h> #define SUB(X,Y) (X)*Y main() int a=3,b=4; printf( %d n ,SUB(a++,b++)); 上面程序的输出结果是( )。
A) 12
B) 15
C) 16
D) 20
点击查看答案&解析
单项选择题
下列程序的输出结果是()。 #define A 100 main() int i=0,sum=0; do if(i=(i 2)*2)continue; sum+=i; while(++i<A); print( %d n ,sum);
A. 2500
B. 2050
C. 4
D. 0
点击查看答案&解析
相关试题
A.x=y==5; B.x=n%2.5;C.x+...
A.x=y==5; B.x=n%2.5;C.x+...
A.FOr-subCaseB.4dDOSizeC.f2_G3IF...
A.FOr-subCaseB.4dDOSizeC.f2_G3IF...
设有说明语句如下: static char str[...