fprintf expects a c-string. You are using c++ string (surprised you didn't get warnings or even an error for this when compiling)
to fix: fprintf(pFileO,"%s",words[i][words[i].size()-j-1].c_str());
The moral of this is that you should not be mixing c with c++, if you decide you wanted to do this in c++, you should be using fstream not FILE objects