title: How do the fwrite() and fread() work when i open a binary file
body: <p>I am learning C and I don't understand the fwrite() and fread().</p>
  
  <pre><code>    double n;
      FILE *p;
      p = fopen("output.dat","w+b");
      rewind(p);
      fread(&amp;n,sizeof(double),1,p);
      printf("%lf",n);
      n = 12.0;
      fwrite(&amp;n,sizeof(double),1,p);
      fclose(p);
  
      return 0;
  </code></pre>
  
  <p>It can't read and write the data as expected, why please</p>