title: Read 32-bit integer from binary file in C++?
body: <p>My binary file looks like this.</p>
  
  <pre><code>00000000: 0000 0803 0000 ea60 0000 001c 0000 001c
  00000010: 0000 0000 0000 0000 0000 0000 0000 0000
  </code></pre>
  
  <p>left column is address.</p>
  
  <p>I just tried to read <code>0000 0803</code>(=2051) as follows</p>
  
  <pre><code>ifstream if;
  if.open("file");
  uint32_t a;
  if &gt;&gt; a;
  </code></pre>
  
  <p>As expected...It did not work :-( <br />
  <code>a</code> was just 0 after execution.<br />
  I tried <code>long, int, unsigned int, unsigned long</code>. All failed.</p>
  
  <p>Why these are not working and how can I achieve the goal?</p>