title: Convert String into all uppercase - C++
body: <p>I am having trouble turning strings to uppercase for an alphabetical sort. My program actually begins to slow down and freeze after the third set of words. What am I doing wrong?</p>
  
  <pre><code>string iName = list[i]-&gt;GetLastName(); // This just returns a string of a name
  string jName = list[j]-&gt;GetLastName();
  
  for(unsigned int k = 0; k &lt; iName.length(); k++)
    {
      iName[k] = toupper(iName[k]);
    }
  
  for(unsigned int l = 0; l &lt; jName.length(); l++)
    {
      iName[l] = toupper(jName[l]);
    }
  </code></pre>