title: Keep track of highest 5 numbers during file input
body: <p>So lets say i have a struct </p>
  
  <pre><code>struct largestOwners
  {
      string name;
      double amountOwned;
  };
  </code></pre>
  
  <p>And i am reading it in from a file using ifstream with 300 names and amounts.</p>
  
  <p>How can i go about keeping track of the highest 5 numbers during input? So i dont have to sort after, but rather track it during ifstream input.</p>
  
  <p>My goal is to keep track of the 5 highest amounts during input so i can easily print it out later. And save time/processing rather than to do it in the future</p>
  
  <p>I get i can store this in an array or another struct, but whats a good algorithm for tracking this during ifstream input to the struct?</p>
  
  <p>Lets say the text file looks like this, when im reading it in.</p>
  
  <pre><code>4025025 Tony
  66636 John
  25 Tom
  23693296 Brady
  363 Bradley
  6200 Tim
  </code></pre>
  
  <p>Thanks!</p>