title: Checking whether chars are uppercase or lowercase in c++
body: <p>I'm a beginner to c++ and I'm stuck at the very beginning.</p>
  
  <p>The problem is simple: a letter is the input and the output should be "it's uppercase" or "it's lowercase", or simply "error" when it's not a letter.</p>
  
  <p>And that's where I got stuck.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  using namespace std;
  
  
  int main(){
  char t;
  cin&gt;&gt;t;
  if (t==toupper(t))cout&lt;&lt;"UPPER";
  else if(t==tolower(t))cout&lt;&lt;"LOWER";
  else cout&lt;&lt;"ERROR";
  return 0;
  
  }
  </code></pre>
  
  <p>That's my code. I have never worked with chars before. It seems that the program cannot know whether it's text or a number/special symbol. How do I get it to tell me whether the letter is upper, lower or an error?</p>