主题:帮帮忙吧
请问
struct point
{ int num;
struct point *next;
};
struct point *creat(void)
{
struct point *head;
struct point *p,*q;
int n;
q=p=( struct point * )malloc(LEN);
head=NULL;
scanf("%d",&n);
p->num=n;
while (p->num!=0)
if (head==NULL)
head=p;
else { q->next=p;
q=p;
p=( struct point * )malloc(LEN);
scanf("%d",&n);
p->num=n; }
q->next=NULL;
return(head);
}
head==NULL是表示什么呢?q->next=p;
q=p;
是什么意思呢?
struct point
{ int num;
struct point *next;
};
struct point *creat(void)
{
struct point *head;
struct point *p,*q;
int n;
q=p=( struct point * )malloc(LEN);
head=NULL;
scanf("%d",&n);
p->num=n;
while (p->num!=0)
if (head==NULL)
head=p;
else { q->next=p;
q=p;
p=( struct point * )malloc(LEN);
scanf("%d",&n);
p->num=n; }
q->next=NULL;
return(head);
}
head==NULL是表示什么呢?q->next=p;
q=p;
是什么意思呢?