title: using sort() in STL to sort an array
body: <p>I am writing code for a question which is: Write a method to sort an array of strings so that all the anagrams are next to each other.
  If my container is vector, it will be very simple, since vector has iterator and can be used in STL sort function which is the code below:
  But what if the container is an array? Array has no iterator and cannot use sort() to sort the array directly. I would like to know is there any way to create a array iterator so that I can use sort() to sort the array directly? 
      Thank you !</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include&lt;string&gt;
  #include&lt;algorithm&gt;
  #include&lt;vector&gt;
  using namespace std;
  
  bool compare(string s1, string s2){
    sort(s1.begin(), s1.end());  //sort return void, not the sorted result!!!!!!!!!!
    sort(s2.begin(), s2.end());
    return s1&lt;=s2;
  }
  
  
  void sort_string(vector&lt;string&gt; &amp;v){
      sort(v.begin(), v.end(), compare);
  }
  </code></pre>
  
  #
  
  <pre><code>If I want to use array itertor:
  
  bool compare(string s1, string s2){
          sort(s1.begin(), s1.end());
          sort(s2.begin(), s2.end());
          return s1&lt;=s2;
  }
  
  
  int sortStrarr(string strarr[], int len){
  
      //sort(strarr's iterator.begin, strarr's iterator.end, compare); ???
  }
  </code></pre>