#include//定义学生结构体 struct student { int num; //学号 float score; //分数 struct student* next; }; //主函数 int main() { struct student a, b, c; //定义student结构体变量 struct student* head, * point; //定义student结构体指针变量 //学号赋值 a.num = 10086; b.num = 10087; c.num = 10088; //分数赋值 a.score = 97.5; b.score = 86.5; c.score = 100; head = &a; a.next = &b; b.next = &c; c.next = NULL; point = head; //do while 循环 do { printf("%d %f n", point->num, point->score); point = point->next; } while (point != NULL); return 0; //主函数返回值为0 }
C语言实现的简单链表,每天收获一小点。



