title: Nulls after each character when writing CString to CFile using Write member
body: <p>I'm currently studying MFC library CFile class and I have a problem with writing data to a file using Write method. When I pass char array as parameter it works perfectly fine:</p>
  
  <pre><code>char c[] = "Hello!"; 
  int size = sizeof(c) / sizeof(c[0]);
  myFile.Write(c, size)
  </code></pre>
  
  <p>Characters that were written to file:</p>
  
  <pre><code>Hello!
  </code></pre>
  
  <p>But when I try to pass CString object as an argument:</p>
  
  <pre><code>CString cS("Hello");
  myFile.Write(cS, cS.GetLength());
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>H e l
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>CString cS("Hello");
  LPWSTR c = cS.GetBuffer();
  myFile.Write(c, cS.GetLength());
  cS.ReleaseBuffer();
  </code></pre>
  
  <p>But the output is the same as above. What may be cause that conversion? Does it happen because text is stored in wide characters?</p>