title: How do you use a bubble sort with pointers in c++?
body: <p>So here's what I have so far:</p>
  
  <pre><code>void sortArray(int amountOfScores, int* testScores)
  {
      for(int i = 0; i &lt; amountOfScores; i++)
      {
          for(int j = 0; j &lt; amountOfScores-1; j++)
          {
              if(*(testScores+i) &gt; *(testScores+j+1))
              {
                  int temp = *(testScores+j);
                  *(testScores+j) = *(testScores+j+1);
                  *(testScores+j+1) = temp;
              }
          }
      }       
      for(int i = 0; i &lt; amountOfScores; i++)
      {
          cout &lt;&lt; *(testScores+i) &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>Basically I'm trying to read in however many numbers the user wants to input, then sort them in ascending order.  Catch is I have to use pointers and I've never really understood them.  This code above works for 3 numbers, however, adding any more causes it to not sort them...I've tried trouble shooting as best I could but without any knowledge in pointers I don't know what I'm looking for.</p>
  
  <p>Thanks for the help!</p>