- Nov 29, 1999
- 16,408
- 57
- 91
So, I have this C++ program that has a config.h file with many #define's, and the code has many #if's and #else's used to control which code get compiled in/out. This was originally done for speed, as a variable compare or check each cycle was too much overhead. Now I want to change this (faster hardware & new requirements) to run-time options, with as little overhead as possible.
I am assuming that function pointers, initialized once at startup, is the best option for this (with a config.txt or config.ini used to populate the values?) Are there any other methods out there you prefer or have used?
*Note - I don't need to change the options while the program is running, but only at initialization. I am just trying to get rid of the need to build multiple executables, based on different config parameters.
Thanks for your suggestions.
I am assuming that function pointers, initialized once at startup, is the best option for this (with a config.txt or config.ini used to populate the values?) Are there any other methods out there you prefer or have used?
*Note - I don't need to change the options while the program is running, but only at initialization. I am just trying to get rid of the need to build multiple executables, based on different config parameters.
Thanks for your suggestions.