title: Difference between files written in binary and text mode
body: <p>What translation occurs when writing to a file that was opened in text mode that does not occur in binary mode? Specifically in MS Visual C.</p>
  
  <pre><code>unsigned char buffer[256];
  for (int i = 0; i &lt; 256; i++) buffer[i]=i;
  int size  = 1;
  int count = 256;
  </code></pre>
  
  <p>Binary mode:</p>
  
  <pre><code>FILE *fp_binary = fopen(filename, "wb");
  fwrite(buffer, size, count, fp_binary);
  </code></pre>
  
  <p>Versus text mode:</p>
  
  <pre><code>FILE *fp_text = fopen(filename, "wt");
  fwrite(buffer, size, count, fp_text);
  </code></pre>