The program should accept the input, find to see if it is in the word, then replace the null character _ with the correct letter.

char Guess[15];
guess looks like this, depending on word size

_ _ _ _ _

Qt Code:
  1. void hangman::guessed()
  2. {
  3. char Letter;
  4. int Correct=0;
  5. QString tochar;
  6.  
  7. tochar = ui->lineEdit->text();
  8.  
  9. QByteArray foo = tochar.toLatin1();
  10.  
  11. char *letter = foo.data();
  12.  
  13.  
  14. Letter = *letter;
  15.  
  16.  
  17. // Loop through the word
  18. for(Subscript = 0; Subscript < Size; Subscript++)
  19. {
  20.  
  21. //if the guess is good tell the user and update Guess
  22. if(copy.at(Subscript) == Letter)
  23.  
  24.  
  25. {
  26.  
  27. Guess[Subscript] = Letter;
  28. Correct = 1;
  29. ui->textBox->append(Guess);
To copy to clipboard, switch view to plain text mode 

instead of proper output like, _ _ e _ _
the textbox gets this appended to it.

ð*º
ð*º
e*º
ð*º`è_ ¸Ñ¦ ««««««««îþîþ

I feel as though its clearly a failed data conversion, I just do not know what to attempt next.