Inside a computer letters(char) are represented by numbers/bits(e.x 0110 1100). It comes from ASCII table(google it). Each letter is given a number and with those numbers you can compare each other.
For example, the letter 'a' is represented by the number 97 and the letter 'b' is represented by the number 98 and the letter 'c' is represented by the number 99, and so on until letter 'z'.
So when your comparing two letters within a computer like 'a'<'b' the computer actually sees 97<98(true) or 'a'=='a' (97 == 97, true).
Note: 'A' and 'a' are not the same. 'a' == 97 while 'A' == 65
In you code on starting on line 12
1 2 3 4 5 6 7 8
|
while (cinput = "a", "b", "c","d","e","f")
{cout<<"Incorrect! Please enter a letter smaller than"<<cinput<<"."<<endl;
}
while (cinput == chrSecretLetter)
{
}
|
lets say the user enters a letter 'a'-'f', then your program will loop forever, because you didn't put in any code to get out of this while loop.
example
user enters 'a'
-goes into while loop
|
while (cinput = "a", "b", "c","d","e","f")
|
-you print out that it's incorrect.
Well cinput is still 'a' so when it loops back around the while loop to the front it's still valid, so the loop happens all over again and again and again .
I would advise against using a while loop right there, and use an if statement.