The answer is YES and NO. It is all matter of your taste, choice and how details you know about your system.
For instance, if you are not very familiar with all the configuration files then from your C code call the external function (call execXX function family) and pass the parameter to it. If you are familiar with all configuration file for your particular platform then modify the configuration file (read/write to configuration file).
Personally, for me since I will do a very similar thing in the near future, my choice is to modify the configuration files and then reboot the system.
Good luck.