title: reading from a binary file into an int
body: <p>i'm a little puzzled about binary files and how to read from them, so if someone could help that would be great.
  i have a file that contains the following bits:
  </p>
  
  <pre class="lang-none prettyprint-override"><code>00000000000000000000000000000111 
  </code></pre>
  
  <p>(32 bits. i  counted)</p>
  
  <p>now i have written this code:
  </p>
  
  <pre class="lang-c prettyprint-override"><code>int main()
  {
      FILE * f1;
      f1 = fopen("file2", "rb");
      int i = 0;
      fread(&amp;i, sizeof(int), 1, f1);
      printf("%d", i);
      fclose(f1);
      return 0;
  
  }
  </code></pre>
  
  <p>that prints me 808464432.
  why? shouldnt it print 7?
  thank you for reading.</p>