ok thanks. the final part is basically, it wil be


which would be


than the user would guess

cin>> guess

then if the letter guessed is in the word it will be revealed


if word was yellow

cin>> e


and when all letters are guessed correctly then the game says you win

cout<<"you win";
then its over =)

a string can be treated like an array of chars.
each char in the string can be accessed through the [] operation

char firstChar; // first character of the name

firstChar = firstName[0];

the code i have for finding chars in strings is:

find and replace characters in a string


cout<<"Before: "<<str<<endl;
int size = str.size();

for (int i=0; i< size; ++i)
{if (str[i]==".")
str[i] = "_";

cout<<"After: " <<str << endl;

replace(str.begin(), st.end(), "_", "_");

cout<<" After replacing for a second time: << str << endl;
return 0;