⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hashelem.h

📁 此代码运行于visual c++ 6.0的环境下
💻 H
字号:
// HashElem1.h: interface for the CHashElem class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_HASHELEM1_H__AD2D4F4D_E06C_4E58_9615_03610BDE403E__INCLUDED_)
#define AFX_HASHELEM1_H__AD2D4F4D_E06C_4E58_9615_03610BDE403E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>
#include <fstream>
#include <ostream>
using std::fstream;
using std::ostream;
using std::string;

class CHashElem  //散列表元素类
{
public:
	string Key;								//记录关键码
	long Pos;								//在倒排文件中的偏移量
	CHashElem( string key, long p ){		//构造函数
		Key = key;
		Pos = p;
	}

	CHashElem( const CHashElem & e){		//拷贝构造函数
		Key = e.Key;
		Pos = e.Pos;
	}
	CHashElem(){}							//构造函数	
	virtual ~CHashElem(){}					//析构函数
	
	CHashElem & operator = ( const CHashElem & e){//重载等号运算符
		Key = e.Key;
		Pos = e.Pos;
		return *this;
	}
	friend fstream & operator <<( fstream & out, CHashElem & elem );//重载文件流运算符
	friend fstream & operator >>( fstream & in, CHashElem & elem );
	friend ostream & operator <<( ostream & out, CHashElem & elem );//重载输出流运算符

};

#endif // !defined(AFX_HASHELEM1_H__AD2D4F4D_E06C_4E58_9615_03610BDE403E__INCLUDED_)

⌨️ 快捷键说明

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