title: Selection Sort of a Array of random strings
body: <p>I am trying to create a selection sort algorithm that takes in an array of random strings and sorts it. 
  I have looked online and in my book to try and model my code off of it and this is what I came up with. I am not sure where I went wrong, any help would be appreciated.</p>
  
  <pre><code>Here is how you load the array with the random strings:
  string Sorter::randomString() {
      string s = "";
      for (int i = 0; i &lt; MAX_CHARS; i++) {
          char randomChar = char(rand() % 26 + 97);
      s += randomChar;
      }
      return s;
  }
  
  void Sorter::load() {
      for (int i = 0; i &lt; MAX_STRINGS; i++)
          workspace[i] = randomString();
  
  Here is my selection sort: 
  
  void Sorter::selectionSort() {
      for (int pass = 0; pass &lt; MAX_STRINGS - 1; pass++) {
          string smallest = workspace[pass];
      for (int pos = pass + 1; pos &lt; MAX_STRINGS - pass - 1; pos++) {
              if (workspace[pos] &gt; smallest) {
                  smallest = workspace[pos];
              }
              swap(workspace[pos], workspace[pass]);
          }
      }
  }
  </code></pre>
  
  <p>I expected the array workspace to be sorted, but it is not :(</p>