title: How to read in a set of values from a text file, then go to the next line and do the same
body: <p>Im trying to read a list like this one</p>
  
  <pre><code>James  John 15 5 1
  Douglas Frank 23 8 1
  Bnejamin Zach 17 1 4
  </code></pre>
  
  <p>and store each value into a a separate variable. The names are strings, and the other numbers are floats and an int. I can get the data from one line so far, but I dont know how to go onto the next line and do the same. Here is my code so far.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;fstream&gt;
  
  
  using namespace std;
  
  int main()
  {
  ifstream employees;
  string lastname, firstname, lastname1, firstname1, lastname2, firstname2;
  float base, sales, base1, sales1, base2, sales2;
  int years, years1, years2;
  
  
  employees.open("employees.txt");
  
  while (employees)
  
    {
  employees &gt;&gt; lastname &gt;&gt; firstname &gt;&gt; base &gt;&gt; sales &gt;&gt; years;
  </code></pre>
  
  <p>I want to keep it as simple as possible, I dont know user defined functions, arrays, or vectors at all yet. So is there a simple function that will just end the line at years; and go to the next line and carry on?</p>
  
  <p>Thanks.</p>