Now I have a significant amount of potential magic numbers stored in constants. They are very adaptable between each assembly. egconst int numAPPLES = 25
right now they are defined at the top of each associated class header. But sometimes they need to be exchanged, and I still need to:
- Copy definition; and conflicting risks.
- include an extra header (this is what I did)
I previously had them all in options.h
, which is great because I can see them all together, but changing the number will obviously lead to a complete overhaul.
If this is important, I am using VS 2010.
What is the best way to allow these numbers to change? I am wondering how I can add a TXT file to a VS project and then extract variables from it.
data types (for now) only char
andint
I also do not want to have all the library dependency just to access them. But a simple recommended class; or a way to build your own, it would be great.
thank!
edit: does this look good to you guys ?: http://www.codeproject.com/KB/cpp/IniReader.aspx
source
share