title: Sorting a string using STL
body: <p>I am trying to sort the characters of a string using <code>C++ STL</code> and came up with this code.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  
  
  int main() 
  {
      using namespace std;
      vector&lt;string&gt;::iterator it;
      string arr[] = {"jajajaj"};
      vector&lt;string&gt; v(arr, arr+2);
      sort(v.begin(), v.end());
      for (it=v.begin(); it&lt;v.end(); it++) {
        cout &lt;&lt; *it;
     }
      return 0;
  }
  </code></pre>
  
  <p>But unfortunately its <strong>not sorting properly when the array contains single element</strong>. How to do it using STL.
  Please help.</p>