Replace all instances of \ with /
Seems to me that the right algorithm for this job is std::replace:

std::replace(input.begin(), input.end(), '\\', '/');


The easiest way to apply to a collection of strings is probably to use std::for_each with a lambda:

std::for_each(files.begin(), files.end(), 
              [](std::string &amp;s) { std::replace(s.begin(), s.end(), '\\', '/'); });


If you can't use a lambda, you can write a tiny function object instead:

class path_dos2unix {
    void operator()(std::string &amp;s) {  
        std::replace(s.begin(), s.end(), '\\', '/');
    }
};


...and then invoke that:

std::for_each(files.begin(), files.end(), path_dos2unix());