title: How to check if the first character of a string is uppercase?
body: <p>I have a function which takes a string as an argument.
  What I want to do is check if the string starts with an upper case letter. If this is true, then I want to return true. If it does not start with an upper case letter then I wish to return false. Simple enough?</p>
  
  <p>The code I was using is this:</p>
  
  <pre><code>bool filter(string word)
      {
          char cWord[50];
          char c;
          for(int i = 0; i &lt;= word.size(); i++)
          {
              cWord[i] = word[i];
          }
          c = cWord[0];
          if(isupper(c)){return true;}
          else{return false;}
      }
  </code></pre>
  
  <p>However I don't think it functions how I would like it to. Can anyone confirm that my function should work correctly, or whether there is a better way to check if the first character is a capital letter?</p>