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

📄 hashelem.cpp

📁 此代码运行于visual c++ 6.0的环境下
💻 CPP
字号:
// HashElem1.cpp: implementation of the CHashElem class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "HashElem.h"
#include <fstream>
using std::endl;

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

//重载文件流<<运算符
fstream & operator <<( fstream & out, CHashElem & elem ){
	out<<endl;
	out<<elem.Key.c_str()<<endl;
	out<<elem.Pos;
	return out;
}

//重载文件流>>运算符
fstream & operator >>( fstream & in, CHashElem & elem ){
	char temp[100];
	in>>temp;
	elem.Key = temp;
	in>>elem.Pos;
	return in;
}

//重载输出运算符
ostream & operator <<( ostream & out, CHashElem & elem ){
	out<<"key:"<<elem.Key<<endl;
	out<<"position:"<<elem.Pos<<endl;
	return out;
}

⌨️ 快捷键说明

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