This is an assignment for class,design a hangman program,I convert the letters of the random word to charchters,when the user inputs there letter how do I compare that with the secret word, and display it,any suggestions????
for(int i = 0; i<word_to_guess.size();i++)
{
word_to_guess[i] = 'X';
}
cout<<word_to_guess<<endl<<endl;
while (lives>0 && wordguessed!=word_to_guess)
{
cout<<"You have "<<lives<<" guesses left"<<endl<<endl;
cout<<"Please enter your guess"<<endl<<endl;
cin>>guess;
lives = lives -1;
lettersguessed = lettersguessed + guess;
solution = word_to_guess.find(guess)
cout<<"Your letters "<<lettersguessed<<endl<<endl;