📄 record.h
字号:
#include "Str.h"
class Record
{ friend bool operator==(const Record &x, const Record &y) {return x.key==y.key; }
friend bool operator<(const Record &x, const Record &y) { return x.key<y.key; }
friend bool operator>(const Record &x, const Record &y) { return x.key>y.key; }
friend bool operator>=(const Record &x, const Record &y) { return x.key>=y.key; }
friend bool operator<=(const Record &x, const Record &y) { return x.key<=y.key; }
friend bool operator!=(const Record &x, const Record &y) { return x.key!=y.key; }
friend istream &operator>>(istream&in,Record& x)
{ in>>x.key; return in; }
public:
Record():key(0){}
Record(String k):key(k){}
Record(const Record& copy)
{ key=copy.key; other=copy.other; }
Record& operator=(const Record& copy)
{ key=copy.key; other=copy.other; return *this; }
Record& operator=(const char *x){ key=x; }
String GetKey(){ return key; }
int length(){return strlen(key); }
private:
String key;
char *other;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -