title: reading hex values from fstream into int
body: <p>I have a text file which has one hex value in each line. Something like</p>
  
  <pre><code>80000000
  08000000
  0a000000
  </code></pre>
  
  <p>Now i am writing a c++ code to read this directly. SOmething like</p>
  
  <pre><code>fstream f(filename, ios::in);
  
  while(!f.eof)
  {
      int x;
      char ch;
      f&gt;&gt;std::hex&gt;&gt;x&gt;&gt;ch;  // The intention of having ch is to read the '\n'
  }
  </code></pre>
  
  <p>Now this is not working as expected. While some of the numbers are getting populated properly, the ch logic is flawed. Can anybody tell me the right way of doing it. 
  I basicaly need to populate an array with the int equivalent.</p>