What is happening in binary IO in C? : <p>I imagine this applies to a lot of other languages as well.</p>

<p>I have this code here, and I am wondering what is actually happening and how I can interpret what is written to the file...</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;

int main () 
{
    //Initialize a variable and load it with input using scanf
    char write[100] = "Write this.";

    FILE *fp = fopen("./binFile.txt", "w+");
    fwrite(write, sizeof(write[0]), sizeof(write)/sizeof(write[0]), fp);
    fclose(fp);
}
</code></pre>

<p>and then when I open the text file I see this...</p>

<pre><code>5772 6974 6520 7468 6973 2e00 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 
</code></pre>

<p>But I am having some trouble seeing exactly what is going on here. How does this text break down to binary?</p>
