#a config (settings). How to write it(them) correctly?

6 messages · Page 1 of 1 (latest)

hidden latchBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

tough vortex
#

"How usually are they made to be updatable at runtime?"
You store these setting saved somewhere on disk (like some shitty json for example) and thus any edits can be done

#

"I don't understand how to write correctly settings"
The answer is - tell me how can a program receive input?
Here's a few ideas:
input from std::cin
environment variables like %APPDATA% or %MyConfigFile% taken with getenv()
reading from save files in json format stored locally next to your exe file
reading from databases, online or offline

there's many others like, running your own web server and accepting connections a.k.a. requests

rugged pier
#

The simplest method I’ve seen is to store the settings in some global fashion (usually some Options class with static variables), and check those options anytime you need them - though there’s also a frameworks that handle observer patterns better, Qt being a big one

tough vortex
#

I dont understand what your goal is

hidden latchBOT
#

This question is being automatically marked as stale.
If your question has been answered, type !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.