各位大佬,我的这个输入的数据为什么进不了我的链表里呢?
struct Node* createList()
{ struct Node* List = (struct Node*)malloc(sizeof(struct Node)); List->next = NULL; return List;}struct Node* createNode(struct Message info){ struct Node* node = (struct Node*)malloc(sizeof(struct Node)); node->info = info; node->next = NULL; return node;}void intertNodeByHead(struct Node* List,struct Message info){ struct Node* newNode = createNode(info); newNode->next = List->next; List->next = newNode;}void Add(struct Node* List){ struct Message p; int n; while(p.name != 0) { printf(“输入信息\n”); printf(“姓名:”); scanf("%s",p.name ); printf(“职务:”); scanf("%s",p.duty ); printf(“职称:”); scanf("%s",p.title ); printf(“电话:”); scanf("%s",p.telephone ); printf(“邮箱:”); scanf("%s",p.Email ); intertNodeByHead(List,p); }
2020-03-11
最新推荐文章于 2022-03-16 23:20:46 发布