📄 dictionary.h
字号:
#include<fstream.h>
#define MAXSIZE 100 //最大能存放的记录数
const int MAXSTR=30; //一个字符串能存放的最大字符数
enum BOOLEAN
{
FALSE=0,
TURE
};
typedef struct word
{
char English[MAXSTR]; //英文单词
char cixing[MAXSTR]; //词性
char Chinese[MAXSTR]; //中文
}word;
class Dictionary
{
public:
Dictionary ();
virtual ~Dictionary();
BOOLEAN init(); //初始化数据成员
int LineCount(ifstream in); //统计文件的行数
int Index(char* s,char* t); //字符串的匹配
void SelectEnglish(); //根据英文单词查询其词性和中文解释
void SelectChinese(); //根据中文查询其英文和词性
void ImageSelect(); //查询以某一前缀开头的单词的词性和中文解释
virtual int Add(); //添加一条记录
virtual int Update(); //修改记录
virtual int Delete(); //删除记录
void Show(); //显示所有记录
friend ostream& operator <<(ostream& stream,word* w); //重载插入符
friend istream& operator >>(istream& stream,word* w); //重载提取符
protected:
word *danci; //指向第一条记录的指针
int num; //当前的记录数
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -