动态链表主要解决内存分配的问题,我们学习动态链表要掌握stdlib 头文件下的内存分配函数 (malloc,colloc,realloc,free等函数)
直接上代码,咋们代码里分析!
#include<stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct Student)
struct Student //创建一个学生的结构体
{
long num;
float score;
struct Student *next;
};
int n; //n为输入了几个学生
void print(struct Student *head ) //输出学生信息的函