With this purpose in mind, ConfigFile is designed to be convenient, portable, and free. Take a look at the class header, class definition, example program, and sample input. Or, download the complete package in zip or tarball format.
Features:
atoms = 250
length = 8.0 # nanometers
name = Reece Surcher
ConfigFile config( "config.inp" );
int atoms = config.read<int>( "atoms" );
double length = config.read( "length", 10.0 );
string author = config.read<string>( "name", "none" );
If you like this software, also try my version of the Mersenne Twister random number generator.
Rick Wagner ( wagnerr@umich.edu ) 26 May 04 |