title: Will memcpy copy a string correctly?
body: <p>I am working on implementing some low-level file writing, where the file format is specific down to each bit. I need to copy a string from an <code>NSString</code> into null-terminated string with length 16 (which is not assignable, according to Xcode). I am a total <em>n00b</em> when it comes to <code>c</code>, and want to be sure I understand this correctly. This is what I am currently doing:</p>
  
  <pre><code>//I have a non-null NSString called _friendly_name.
  const char *string = [_friendly_name UTF8String];
  //profile.friendly is a utf-8 null-terminated string
  memcpy(&amp;profile.friendly_name, &amp;string, 16);
  </code></pre>
  
  <p>This has not yet been tested, but I want to be sure this will work. Will this provide the behavior I am expecting? Or should I be copying the string a different way (such as <code>strcpy</code>)?</p>