title: Sorting a pointer array of strings
body: <p>The swap function in my sortArray function doesn't seem to work properly. Error is: 
  <code>No viable overloaded operator[] for type 'string *' (aka 'basic_string&lt;char, char_traits&lt;char&gt;, allocator&lt;char&gt; &gt; *')</code>.</p>
  
  <p>I managed to find the item that goes first in the output, but now I just need a bit of help getting the rest of the user input to display as intended.
  To recap, the program needs to read in that many single-word names (one for each Pokemon) from the user and store the names in an array. After the user has finished entering their names, the program should display the list of all the pokemons the user entered, but in alphabetical order. The farthest I've got for the output was:</p>
  
  <pre><code>Welcome! How many Pokemon do you own?
  
  4
  </code></pre>
  
  <p><code>Ok, enter the names!</code></p>
  
  <pre><code>Pikachu
  
  Snorlax
  
  Ekans
  
  Squirtle
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Thanks, here are the pokemon you entered: Ekans Ekans Ekans Ekans Program ended with exit code: 0
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "playground.h"
  using namespace std;
  
  string findFirst(string *x, int start, int end)
  {
      string first = x[0];
      for(int i=start; i &lt;= end; i++)
      {
          if(x[i] &lt; first)
          {
              first = x[i];
          }
      }
      return first;
  }
  
  void sortArray(string *items, int start, int end)
  {
      for(int i=start; i&lt;=end; i++)
      {
          string min = findFirst(items,i, end);
          swap(items[i], items[min]);
      }
  }
  
  
  int main()
  {
      cout&lt;&lt;"Welcome! How many Pokemon do you own?"&lt;&lt;endl;
      int num = 0;
      cin &gt;&gt; num;
  
      cout&lt;&lt; "Ok, enter the names!"&lt;&lt;endl;
      string *names = new string[num];
      for(int i=0; i&lt;num; i++)
      {
          cin&gt;&gt;names[i];
      }
      cout&lt;&lt;"Thanks, here are the pokemon you entered: ";
      for(int i=0; i&lt;num; i++)
      {
          cout &lt;&lt; sortArray(names, 0, num) &lt;&lt; " ";
      }        
  
      return 0;
  }
  </code></pre>