 <p>First you read a byte from <code>pFile1</code> with <code>fgetc()</code> so the file pointer has moved one step ahead, then you do a <code>fread()</code> so the first byte will never land in <code>buffer</code></p> <pre><code> for(counter=0; counter&lt;fileLen; counter++) { fputc(fgetc(pFile1),pFile2); ch = fread(buffer, sizeof(char), 6000000, pFile1); printf("%02x", buffer[counter]); } </code></pre> <p>I find it a bit difficult to understand why you do the fread in the manner you do. If you really want to display the byte you just read then just assign the return value from <code>fgetc</code> to a variable and print it out .</p> <pre><code> for (counter=0; counter&lt;fileLen; ++counter) { int ch = fgetc(pfile1); printf("%02X", ch ); int written = fputc(ch,pfile2); if (written != EOF) { buffer[counter]=ch; } else // some error handling } </code></pre>