title: Append to a File with fstream Instead of Overwriting
body: <p>I'm trying to create a basic highscore system for a project I'm working on.</p>
  
  <p>The problem I'm having is, although I write the names into my main they just overwrite the previous.</p>
  
  <p>Currently I have this:</p>
  
  <pre><code>void ManagePoint::saveScore(string Name, int Score)
  {
  
      ofstream newFile("scorefile.txt");
  
      if(newFile.is_open())   
      {
          newFile &lt;&lt; Name &lt;&lt; " " &lt;&lt; Score;            
      }
      else 
      {
          //You're in trouble now Mr!
      }
  
  
      newFile.close();
  
  }
  </code></pre>
  
  <p>and for testing I'm adding them like so:</p>
  
  <pre><code>runner-&gt;saveScore("Robert", 34322);
  
  runner-&gt;saveScore("Paul", 526);
  
  runner-&gt;saveScore("Maxim", 34322);
  </code></pre>
  
  <p>On load display all that will appear is Maxim's score, how can I loop through and save them all, or append all or something?</p>