title: How do I allow uppercase and lowercase user input?
body: <p>I'm a newbie C++ programmer. I've written a basic emotion checker that reacts based on your reply that gets fetched from an array. I'm wondering how to make it so that the replies work in both upper and lower case when typed in? E.g. when the user types in "happy" or "Happy" both would work. I've read about switch statements and toupper/tolower but I'm lost on how to implement these for my code. Here it is:</p>
  
  <pre><code>// Array of emotions
  
  string positive[] = {"happy", "pleased", "joyful", "excited", "content", "cheerful", "satisfied", "positive"};
  string negative[] = {"unhappy", "sad", "depressed", "gloomy", "down", "glum", "despair", "negative"};
  
  string reply;
  
  cout &lt;&lt; "Please state your current emotions." &lt;&lt; endl;
  cin &gt;&gt; reply;
  
  for (int i = 0; i &lt; 10; i++)
  
  if (reply == positive[i])
  {
          cout &lt;&lt; "I am glad to hear that!" &lt;&lt; endl;
  }
  
  else if (reply == negative[i])
  {
      cout &lt;&lt; "I am sorry to hear that." &lt;&lt; endl;
  }
  </code></pre>