More Readable Settings File

Create issue
Issue #13 new
Michael Backus repo owner created an issue

In response to a question I posed regarding how to make the settings file more readable, Orion Lawlor sent the following email:

Since you're reading the whole line, and atoi ignores anything after the number I think you can already add (optional, ignored by the program) comments to the file, anything like:

0 minimum hue 100 // maximum hue -23; minimum saturation 1000 = maximum saturation

I'm torn on this problem, myself. I have a habit of starting very simple, with trivial hardcoded file I/O right in the program, then I add some utility functions (like "int read_int(std::istream &file)"), then I add an I/O library like SuperEasyJSON for a standard file format like JSON. Then for the next project I skip it all and do hardcoded I/O again!

Comments (0)

  1. Log in to comment