
Config files: best to use struct when reading in data
Quote:
> Whats the "accepted practice" when reading in config files?
> Is it best to read them into a structure?
> Then refer to struct->field1 etc.
> My config file is a simple hash database similar to:
> Name Bruce
> Age 25
> Department Marketing
> Phone 01122 34566
That's not a configuration file, it's a data file. Depending on
its size, you might want to use a number of data structures. Can
you give us more details?
--
"To get the best out of this book, I strongly recommend that you read it."
--Richard Heathfield