链表:10-释放链表并删除文件
函数原型:void destory_list_and_file(GoodsList **L),
该函数调用destory_list释放包括头结点在内的所有结点,将指向链表头结点的指针为NULL,最后删除存储商品信息的文件goodinfo.txt。
参考代码:
#include <stdio.h>
#include <stdlib.h>
#include "lab52.h" // 请不要删除本行头文件,否则检查不通过
extern int CurrentCnt; // 请不要删除本行的全局变量声明,否则检查不通过
void destory_list_and_file(GoodsList **L){
destory_list(*L);
*L=NULL;
CurrentCnt =0;
remove("goodinfo.txt");
}