c语言关于链表操作问题 这里q->next=p;q=p;和p->next=p一样?

#include<stdlib.h>
#include<string.h>
#define NEW (struct node *)malloc(sizeof(struct node))
struct node
{char name[20],tel[9];
struct node *next;
};
struct node *create()
{struct node *h,*p;
char name[20];
h=NULL;
gets(name);
while(strlen(name)!=0)
{p=NEW;
if(p==NULL)exit(0);
strcpy(p->name,name);
gets(p->tel);p->next=NULL;
if(h=NULL)h=p;
else q->next=p;
q=p;
gets(name);
}return h;
}
main()
{struct node *head;
head=create();
}

一个单一的名单呢? 如果一个单独的列表,对 - >下一个到下一个节点,对 - >下一个= Q->接下来是指在q>下一个指到下一个节点米(节点Q)分配到p地址 - >下一个,这是下一个节点变为熔点追问

如果我要把名单输出 该怎么改呢?

温馨提示:答案为网友推荐,仅供参考
相似回答