I have a C++ file in my C++ project in Visual Studio.
The C++ file has a snippet wherein some applications are run using system
system("Files\\tx1");
system("Files\\tx2");
system("Files\\tx3");
system("Files\\tx4");
I want to replace the “Files” constant with some constant variable which can be changed at a single place. Something like what we wuld do in C# with app.config files etc.
Directly hardcoding a constant is not a good practice. C++ project doesn’t have settings file unlike C# projects. So, any suggestions what I should do in this case?
If you want to use a compile time approach (as with the
app.configin C#) you can use defines.conf.h
impl.c
When you prefer a runtime approach, there are numerous formats/libraries for configuration files.