title: What code should be written to accept Lower and Upper case choices?
body: <p>I'm beginner to c++ and writing a program that accepts user choices and acts according to it...my only problem is when the user enters Uppercase choice...the program treats it as it's a wrong choice...like if 'e' was a choice for entering a number..if the user entered 'E' the program won't display the "enter the number" message..how can i fix it ? i tried my best but i can't get it working.. Oh , and how can i add the Uppercase in Switch cases ?
  This is the part of the code that's responsible of taking user's choice and act according to it.</p>
  
  <pre><code> #include &lt;iostream&gt;
   #include &lt;cstring&gt;
   using namespace std;
  
   int main(){
  
   char choice ;
  
   for(;;){
      do{
        cout &lt;&lt; endl ;
        cout &lt;&lt; "(e)nter." &lt;&lt; endl ;
        cout &lt;&lt; "(d)isplay." &lt;&lt; endl;
        cout &lt;&lt; "(u)pdate." &lt;&lt; endl ;
        cout &lt;&lt; "(r)eset. " &lt;&lt; endl;
        cout &lt;&lt; "(q)uit." &lt;&lt; endl;
        cout &lt;&lt; endl;
        cout &lt;&lt; "Choose one : " ;
        cin &gt;&gt; choice ;
  
        if( !strchr("edurq",choice) &amp;&amp; (choice&gt;=97&amp;&amp;choice&lt;=122) ){
           cout &lt;&lt; "Enter e,d,u or q " &lt;&lt; endl;}
  
        else if( !strchr("EDURQ",choice) &amp;&amp; (choice&lt;97&amp;&amp;choice&gt;122) ){
           cout &lt;&lt; "Enter E,D,U or Q " &lt;&lt; endl;}
  
      }while( !strchr("edurqEDURQ",choice) );
  
   switch (choice) {
       case 'e' : enter(); break ;
       case 'd' : display(); break ;
       case 'u': update() ; break ;
       case 'r' : reset() ;break;
       case 'q' : return 0;
      }
  
    }
  } 
  </code></pre>