title: Switch an array sort from descending order to ascending order
body: <p>So my program has a function in which I read the numbers from a text file into an array and then sort them in ascending order.  However, instead of sorting in ascending order my code sorts in descending order.  What do I need to change here in order to get my code to work the way I need it to?</p>
  
  <pre><code>void displaySortedNums(string fileName)
  {
      ifstream inFile;
      inFile.open(fileName + ".txt");
      int numbers[50];
      int arraySize = 0;
  
      if (!inFile.is_open())
          {
              cerr &lt;&lt; "\nUnable to open file " &lt;&lt; endl &lt;&lt; endl;
          }
      if (inFile.peek() == std::ifstream::traits_type::eof())
          {
              cout &lt;&lt; "\nData file is empty" &lt;&lt; endl &lt;&lt; endl;
              cout &lt;&lt; "File Successfully Read" &lt;&lt; endl &lt;&lt; endl;
          }
      else
          {
              inFile &gt;&gt; numbers[arraySize];
              while (inFile)
                  {
                      arraySize++;
                      inFile &gt;&gt; numbers[arraySize];
                  }
              numbers[arraySize] = '\0';
              double temp;
              for (int i = 0; i &lt; arraySize + 1; i++)
              for (int j = 0; j &lt; arraySize + (i + 1); j++)
                      if (numbers[j] &lt; numbers[j + 1])
                      {
                          temp = numbers[j];
                          numbers[j] = numbers[j + 1];
                          numbers[j + 1] = temp;
                      }
              for (int i = 0; i &lt; arraySize; i++)
              {
                  cout &lt;&lt; numbers[i] &lt;&lt; endl;
  
              }
          }
  
      system("PAUSE");
      return;
  }
  </code></pre>