Quote:Original post by DarkAnima
The suggestion was made to remove the spaces, but that would involve creating new variable sets for storing the values without spaces and then turning those into values with spaces after loading, which would take a long time and a lot of code.
What?
string s; // So our routine doesn't affect states = Player1.name;replace(s.begin(),s.end(),' ','_');fout << s << endl;s = Player2.name;replace(s.begin(),s.end(),' ','_');fout << s << endl;s = Player3.name;replace(s.begin(),s.end(),' ','_');fout << s << endl;// etc
// No need for intermediates herefin >> Player1.name;replace(Player1.name.begin(),Player1,name.end(),'_',' ');fin >> Player2.name;replace(Player2.name.begin(),Player2,name.end(),'_',' ');fin >> Player3.name;replace(Player3.name.begin(),Player3,name.end(),'_',' ');// etc