By the way, I was looking at the rest of your code and I was wondering, can't you make an array with guesses and replace the lines 31 to 51 with something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
string guess [] = {"COMPUTING","INFORMATION","SCIENCE"};
int guesspick=rand()%3;
string guessString = guess[guesspick];
int guessStringLen = guessString.length();
string Replacedstring;
//string AllReplacedStrings
for(int h=1; h<=4; h++) // I don't know what you exactly want, but in this current code I rewrote for you, the forloop is kinda useless.
{
Replacedstring = guessString.replace(rand()%guessStringLen, 1 , "_");
//AllReplacedStrings += Replacedstring
}
cout << Replacedstring<<endl;
//cout << AllReplacedStrings<<endl;