title: Trying to read a file till the very end(not working)
body: <p>I'm trying to read a file(a ROM actually). The thing is that my program stops before actually reaching the end of the file. Here's what I wrote:</p>
  
  <pre><code>int main(){
  cout &lt;&lt; "Entter the file to read in HEX: " ;
  string fileName;
  cin &gt;&gt; fileName;
  
  ifstream streamLecture(fileName);
  unsigned char charLu;
  while(!streamLecture.eof()){
      streamLecture &gt;&gt; charLu;        
      cout&lt;&lt; hex &lt;&lt; setw(2) &lt;&lt; setfill('0') &lt;&lt; short(charLu) &lt;&lt; ' ';
  }
  streamLecture.close();
  
  cout &lt;&lt; endl;
  }
  </code></pre>
  
  <p>This program cout a few lines of HEX values but I know there are a lot more since I  read the file in a HEX editor program.</p>
  
  <p>EDIT: Ok, so i'm assuming there is an EOF in the middle of my file, how do I skip it or continue reading afterwards? Thanks again</p>