define.h

来自「一个海量图书查询系统」· C头文件 代码 · 共 38 行

H
38
字号
#include <iostream.h>
#include <fstream.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>

#define RECORDNUMBER 10000*100  //图书记录数为100万  

struct book
{
	char ISBN[11];       //图书ISBN号为10位,最后1位为串结束标志'\0'
	char category;       //图书分类分为'0'-'9'
	char bookname[61];   //图书名称为60位,最后1位为串结束标志'\0'
	char authors[11];     //作者为10位字符的组合,最后1位为串结束标志'\0'
	book()               //初始化
	{
	 ISBN[0]=NULL;
	 category='0';
	 bookname[0]=NULL;
	 authors[0]=NULL;
	}
};

struct indexISBN     //图书ISBN号索引信息        
{
	long serialnumber;   //保存原始记录在book中的相对位置
	char ISBN[11];       //图书ISBN号为10位
	indexISBN()               //初始化
	{
 	 serialnumber=0;
	 ISBN[0]=NULL;
	}
};

#define HASHSIZE 10001    //hash表的大小为1万零1
//按图书索引表中ISBN号的前四位数据建立hash表,hash表中只记录ISBN号在排序好的索引文件"indexdata.dat"中的起始位置

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?