title: C++ file reading problems
body: <p>Having a problem trying to get this code working.  Here's my text file:</p>
  
  <pre><code>Raisin Bran
  3.49
  300
  Milk
  1.49
  200
  White Bread
  2.49
  100
  Butter
  2.49
  100
  Grape Jelly
  1.09
  50
  </code></pre>
  
  <p>Here's a part of my code:</p>
  
  <pre><code>    inFile &gt;&gt; tempy;
      grocery_items[k].set_item_name(tempy);
      inFile &gt;&gt; temp;
      grocery_items[k].set_item_price(temp);
      inFile &gt;&gt; stock;
      grocery_items[k].set_qty_on_hand(stock);
  </code></pre>
  
  <p>For some reason, it only reads the word "raisin" and the numbers after.  This is because the first line has two words, not one and my inFile is only doing one word at a time.  If I combine the two words into one word, the entire code works fine(for example, Raisin Bran becomes RaisinBran).  Is there a way for me to be able to do this without making everything one word?</p>
  
  <p>When I turn the first line into <code>getline(inFile, tempy)</code>
  The first line prints, however the numbers just repeat over and over again.</p>