title: read file line by line and store different variables
body: <p>My text file look like this:</p>
  
  <pre><code>1     52    Hayden Smith        18:16   15  M   Berlin
  2     54    Mark Puleo          18:25   15  M   Berlin
  3     97    Peter Warrington    18:26   29  M   New haven
  4     305   Matt Kasprzak       18:53   33  M   Falls Church
  5     272   Kevin Solar         19:17   16  M   Sterling
  6     394   Daniel Sullivan     19:35   26  M   Sterling
  7     42    Kevan DuPont        19:58   18  M   Boylston
  8     306   Chris Goethert      20:00   43  M   Falls Church
  9     262   James Sullivan      20:12   28  M   Sterling
  10    348   Bill Gaudere        20:17   54  M   Hudson
  11    13    Travis Wheeler      20:23   31  M   Clinton
  12    69    Eric Anderson       20:34   54  M   Clinton
  13    341   Alex Teixeira       20:46   0   M   Clinton
  14    112   James Long          20:50   38  M   0
  15    279   Nate Richards       21:31   17  M   Berlin
  ......................................................
  </code></pre>
  
  <p>There are eight columns, separated by 'tabs', except the first name and last name is separated by a space. </p>
  
  <p>I must have eight different types of variables. </p>
  
  <pre><code>    int a;
      int b;
      string c;
      string d;
      string e;
      int f;
      char g;
      string h;
  </code></pre>
  
  <p>I need to read the file line by line and cout every line's a, b, c, d, e, f.
  I also need those variables for later use. </p>
  
  <p>So, I tried this: </p>
  
  <pre><code>std::ifstream infile("text.txt");
  int a;
  int b;
  string c;
  string d;
  string e;
  int f;
  char g;
  string h;
  
  
  while(infile&gt;&gt;a&gt;&gt;b&gt;&gt;c&gt;&gt;d&gt;&gt;e&gt;&gt;f&gt;&gt;g&gt;&gt;h)
  {
      cout &lt;&lt;"C is: "&lt;&lt;c&lt;&lt;endl;   // just to see if the loop is working.
  
  }
  </code></pre>
  
  <p>I don't need arrays and vectors to store those variables, I have a linked structure. Right now, I just need a way to read the file and store those strings and integers into variables. 
  But it's not working, lol. Don't know why. I also thought about using getline, something like this:</p>
  
  <pre><code>while(getline(infield, s)):
  </code></pre>
  
  <p>But, isn't this essentially just giving me one big fat line, with all strings and integers smashed together. </p>