title: How to sort each character string of character string array
body: <p>I want to sort each string of array of strings , here is my code that i tried. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  
  void _sort_word(char *str)
  {
      int len = strlen(str); 
      std::sort(str,str+len); // program get stuck here. 
  }
  int main()
  {
      char *str[] = {"hello", "world"};
      for(int i=0;i&lt;2;i++){
          _sort_word(str[i]);
          cout &lt;&lt; str[i] &lt;&lt; "\n";
      }
  }
  </code></pre>
  
  <p>I want to know is <code>sort(str,str+len);</code> a valid statement here, if not what should be done instead ? </p>