title: Using ifstream to read floats
body: <p>I'm trying to read a series of floats from a .out file using ifstream, but if I output them afterwards, they are not correct.</p>
  
  <p>This is my input code:</p>
  
  <pre><code>float x, y, z;
  
  ifstream table;
  table.open("Resources/bones.out");
  if (table.fail())
  {
      cout &lt;&lt; "Can't open table" &lt;&lt; endl;
      return ;
  }
  
  table &gt;&gt; x;
  table &gt;&gt; y;
  table &gt;&gt; z;
  
  cout &lt;&lt; x &lt;&lt; " " &lt;&lt; y &lt;&lt; " " &lt;&lt; z &lt;&lt; endl;
  
  table.close();
  </code></pre>
  
  <p>My input file:</p>
  
  <pre><code>0.488454 0.510216 0.466979
  0.487242 0.421347 0.472977
  0.486773 0.371251 0.473103
  ...
  </code></pre>
  
  <p>Now for testing, i'm just reading the first line into <code>x</code> <code>y</code> and <code>z</code> and my output is </p>
  
  <pre><code>1 0 2
  </code></pre>
  
  <p>Any ideas as to why I'm not getting  the right output?</p>