title: Reading from a binary file using fread() displays additional characters
body: <p>My question is about this <code>fread()</code> function that seems to be confusing for the time being. I create a binary file and put inside of it the values <strong>1</strong>,<strong>2</strong> and <strong>3</strong>. And then I try to read the file and when I do using <code>fread()</code> it shows it like <strong>1233</strong> not <strong>123</strong>. </p>
  
  <hr>
  
  <pre><code>#include &lt;stdio.h&gt; 
  #include &lt;stdlib.h&gt;     
  main ()
  {
    int x=1,y=2,z=3,i,j;
    FILE *f;
    f=fopen("Werid.bin","wb");
    fwrite(&amp;x,sizeof(int),1,f);
    fwrite(&amp;y,sizeof(int),1,f);
    fwrite(&amp;z,sizeof(int),1,f);
    fclose(f);
    f=fopen("Werid.bin","rb");
    if (!f) perror("X");
    while(!feof(f))
      {
        fread(&amp;j,sizeof(int),1,f);
        printf("%d",j);
      }
    fclose(f);
  }
  </code></pre>
  
  <p>Why?</p>