Good day, dear experts. Without further ado I will describe what is needed. But I need to edit the hosts (drivers / etc) file with C ++ through the console program. That is, I write the specified text, which it will replace (before that I backup the file), run the file, and it changes the text. I am interested in any methods, but preferably simpler ones (first-year student, just started to learn programming. But I want to step forward a bit, as the speed of work on pairs does not satisfy at all). I hope for your help. I looked in Google, I found several commands, but I didn’t quite understand how to use them. If possible, give a small example.
UPD: Additional question. Android (as I read on the wiki) also has this file. Tell me, does it affect all applications or just the browser?