Program enters if statement even though requirements aren't met

My program gets user input and compares it against an array of characters (guessLetters[x]) to decide whether the do/while loop repeats. The whole character array contains underscores yet if i enter any letter it goes into the if statement and repeats the do/while loop. Can't seem to see what i'm missing and hopefully someone else can.

do
{
repeatflag = false;
cin >> UserInput;
UserInput = toupper(UserInput);

for(int x = 0; x < m_SelectedString.length(); x++)
{
if(UserInput == guessLetters[x]);
{
cout << "You already entered that, Please enter a different letter";
repeatflag = true;
break;
}
}
}
while(repeatflag == true);
if(UserInput == guessLetters[x]); <-- remove that semicolon
Don't i feel ridiculous.....thank you very much
Topic archived. No new replies allowed.