Switch always outputting default value on guess a number game
<p>I'm trying to get a program to work that will guess which number the user is thinking of, however it currently only outputs the default switch action every time. Please tell me what I've done wrong? Thank you!</p>

<pre><code>srand(time(0));
int lowernum = 1;
int highernum = 1000;
int number=rand()%highernum + lowernum;
string letter = "";
int letternum = 0;

cout&lt;&lt;"\nOkay, think of a number between one and 1000 
and I will try to guess it!\n";
cout&lt;&lt;"\nIs your number higher (h), lower (l) 
or exactly (e): " &lt;&lt; number &lt;&lt; "\n";
cin&gt;&gt;letter;

if (letter == "h")
{
    letternum = 1;
}
else if (letter == "l")
{
    letternum = 2;
}
else if (letter == "e")
{
    letternum = 3;
}

switch(letternum){
case'1': highernum = number; cout&lt;&lt;"\nIs your number higher (h), 
lower (l) or exactly (e): " &lt;&lt; number &lt;&lt; "\n"; cin&gt;&gt;letter;
    break;
case'2': lowernum = number; cout&lt;&lt;"\nIs your number higher (h), 
lower (l) or exactly (e): " &lt;&lt; number &lt;&lt; "\n"; cin&gt;&gt;letter;
    break;
case'3': cout&lt;&lt;"\nWahoooooo! I win! :D\n";
    break;
default:cout&lt;&lt;"\nI don't understand what you just typed in.\n";
    break;

}
</code></pre>
