Config files: best to use struct when reading in data 
Author Message
 Config files: best to use struct when reading in data

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



Thu, 24 Apr 2003 03:00:00 GMT  
 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


Thu, 24 Apr 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. are there better ways to read config file?

2. Reading binary data (struct) from file

3. the best way to read data from a file

4. Best way to have config file for Assembly?

5. Tab delimited data file: read using sscanf

6. read Config-file module for C?

7. reading config files

8. basic config file read

9. How to read a config file in C

10. looking for function to read config file

11. Library for reading config files?

12. read config file

 

 
Powered by phpBB® Forum Software