简单的复习一下静态链表(见代码)
#include <stdio.h> struct Student //创建结点信息 { int num; int score; Student *next; }; int main() { Student a,b,c,*head,*p; //定义结点 a.num=1; //结点赋值 b.num=2; c.num=3; a.score=88; b.score=99; c.score=100; head=&a; //保存链表表头 a.next=&b; //链接链表 b.next=&c; c.next=NULL; p=head; //取出表头 do //打印输出 { printf("%d %d\n",p->num,p->score); p=p->next; }while(p); return 0; }