在头文件list_function.h中声明结构体
/**
*声明结构体变量
*/
typedef struct{
char number[30]; //学号
char name[30]; //姓名
char sex[30]; //性别
char tel[30]; //电话
char loc[30]; //地址
}Student;
typedef struct{
Student* elem[N]; //储存空间的基地
int length; //数据结构的长度
}SqList;
在头文件list_function.h中声明一个外部链表
extern SqList *L;
在list_function.cpp中实例化
SqList *L;
然后在其他.cpp文件中加载list_function.h头文件就可以调用这个结构体变量了。
备注:在学习QT中遇到的困难,解决后觉得记录下来