(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
(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
若有下面的说明和定义:
struct test
char m2;
float m3;
union uu
char u1[5];
float u2;
ua;
MyStruct;
则sizeof(MyStruct)的值是( )。
A:10 B:11 C:12 D:9
若有下面的说明和定义: struct test { char m2; float m3; union uu{ char u1[5]; float u2; }ua; }MyStruct; 则sizeof(MyStruct)的值是( )。
A:10 B:11 C:12 D:9
第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
(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
第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