title: C++ toupper Syntax
body: <p>I've just been introduced to toupper, and I'm a little confused by the syntax; it seems like it's repeating itself. What I've been using it for is for every character of a string, it converts the character into an uppercase character if possible.</p>
  
  <pre><code>for (int i = 0; i &lt; string.length(); i++)
  {
      if (isalpha(string[i]))
      {
          if (islower(string[i]))
          {
              string[i] = toupper(string[i]);
          }
      }
  }
  </code></pre>
  
  <p>Why do you have to list <code>string[i]</code> twice? Shouldn't this work?
  <code>toupper(string[i]);</code> (I tried it, so I know it doesn't.)</p>