title: Does c++ file ostream or file print function output '\0' to file when output a char array
body: <p>I want to write some data to a binary file. I output a char array to a file like this</p>
  <pre class="lang-cpp prettyprint-override"><code>std::ofstream os;
  os.open(&quot;myfile&quot;, std::ios::out | std::ios::binary);
  os&lt;&lt;&quot;A&quot;;
  os.close();
  </code></pre>
  <p>or</p>
  <pre class="lang-cpp prettyprint-override"><code>char a[]=&quot;A&quot;;
  File* file = fopen (&quot;myfile&quot;,&quot;wb&quot;);
  fprintf(file,&quot;%s&quot;,a);
  </code></pre>
  <p>And in the end, does the file includes the '\0'?</p>
  <p>In other words, the data of the file is 0x41 or 0x4100 in hexadecimal。</p>