📄 struct.c
字号:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <dos.h>
#include <conio.h>
#include <string.h>
#include <windows.h>
#include <winnt.h>
//#include <kernel32.lib>
//----------------------------------主数据库文件//
#define BookSize 260
#define BLHnum 260
#define RRnum 260
int a=0,i=0,p=0,q=0,r=0,s=0,t=0; //a->删除书数组计数,i->书库总数,p->读者注册数,q->借书记录数,r->书名数组计数,s->作者数组计数,t->出版社数组计数
//-----------------------------删除数组//
int book[BookSize];
typedef struct BookRecType1{
char bno[10]; //书号
char bname[21]; //书名
struct BookRecType1 *namenext; //书名指针链
char author[9]; //作者
struct BookRecType *authnext; //作者链指针
char press[11]; //出版社
struct BookRecType *prenext; //出版社链指针
char sortno[4]; //分类号
int storenum; //馆藏数目
int canborrownum; //可借数目
int borrownum; //数据库记录类型
}BookRecType;
typedef struct{
BookRecType BookDbase[BookSize];
int len; //文件当前长度
}BookDbaseFile;
BookDbaseFile Dbasehead;
//-----------------------------------书号索引文件//
typedef struct{
char bno[10]; //书号
BookRecType *lhead; //记录指针
}BidxRecType; //索引文件记录类型
typedef struct{
BidxRecType BnoIdx[BookSize];
int len; //当前记录个数
}BnoIdxFile;
BnoIdxFile IdxFile;
//-----------------------------------书名链表头索引文件//
typedef struct {
char bname[21]; //书名
BookRecType *lhead; //链表指针
int RecNum; //长度
}BNRecType; //书名链表头文件记录文件
typedef struct{
BNRecType LHFrec1[BLHnum];
int len1; //链表文件当前长度
}LHFile1; //书名链表文件类型
LHFile1 File1;
//-----------------------------------作者链表头索引文件//
typedef struct {
char author[9]; //作者
BookRecType *lhead; //链表指针
int RecNum; //长度
}BARecType; //作者链头文件记录类型
typedef struct{
BARecType LHFrec2[BLHnum];
int len2;
}LHFile2;
LHFile2 File2;
//----------------------------------出版社链头索引文件//
typedef struct{
char press[11]; //出版社
BookRecType *lhead; //链头指针
int RecNum; //长度
}BPRecType; ///出版社链头文件记录类型
typedef struct{
BPRecType LHFrec3[BLHnum];
int len3;
}LHFile3; //出版社链头文件类型
LHFile3 File3;
//-----------------------------------读者文件//
typedef struct {
int rno; //读者学号
char name[8]; //读者名
int bn1; ///可借书数
int bn2; //已借书数
}RRecType; //读者文件记录类型
typedef struct{
RRecType ReadRec[RRnum];
int len; //当前读者数
}ReadFile1; //读者文件类型
ReadFile1 File4;
//----------------------------------借还书文件//
typedef struct{
int rno; //读者号
char bno[10]; //书号
char date1[9]; //借书日期
char date2[9]; //还书日期
}BbookRecType; //借还书文件记录类型
typedef struct{
BbookRecType Bbook[BookSize];
int len; //当前借书数
}BookFile; //借还书文件类型
BookFile File5;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -