第五周,第二天,学习了链表,没太搞懂
#include<stdlib.h>
structstu
{int number;
char name[10];
struct stu *next
};
struct stu*head,*pve;
head=(struct stu*)mallo(sizeof(stu));
强制类型转换
malloc申请空间
head->number=1;
strcpy(hea->name,"zhang");
printf("%d %s",head->num,head->name);
pve=(struct stu*)malloc(sizeof(stu));
head->next=pve;
head->next->number=2;
strcpy(head->next->name,"wang");