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

📄 inifile.h

📁 linux下的一个分组遗传算法
💻 H
字号:
//// inifile.h - A general inifile class//// author: J.I.v.Hemert// last updated : 08-10-1997//// This file contains the class IniFileC, which can be used to read in// values (strings, doubles and integers) from an external inifile. It// still has some constraints. Labels cannot be longer than 300 characters// and the number of labels cannot exceed 50. The inifile should consist of// lines like this : "value = 0". The spaces around the equalsign must be// there. Empty lines are ignored, just as lines starting with an #.//#ifndef INIFILE_H#define INIFILE_H#include <string.h>#include <fstream.h>#include <stdlib.h>#include <malloc.h>#define MAXLABELS 50#define MAXSTRINGLENGTH 300typedef char StringT[MAXSTRINGLENGTH];class IniFileC{	public:		void Open (StringT filename);			// Open file and read in labels		char * ReadString (StringT label);		// Return string with label		double ReadDouble (StringT label);		// Return double with label		int ReadInt (StringT label);			// Return integer with label		bool ReadBool (StringT label);			// Return boolean with label	private:		int nroflabels;		StringT labels[MAXLABELS];		StringT data[MAXLABELS];		StringT name;		ifstream filedata;};#endif// eof inifile.h

⌨️ 快捷键说明

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