title: How to strcpy and return number of copied characters?
body: <p>I want to copy a null-terminated string to another location and want to know how long the copied string was. Efficiency is of utmost importance. There ist the <code>strcpy</code> function which can achieve this, but it does not return how many characters are actually copied.</p>
  
  <p>Of course, I could find this out by simply calling <code>strlen</code> afterwards to detect the length of the copied string, but this would mean traversing the characters in the string again a second time, although <code>strcpy</code> has to track how many characters it copies anyway. For performance reasons, I do not want such a second traversal.</p>
  
  <p>I know that writing an own <code>strcpy</code> with a simple char-by-char copy is easy, but I thought that the standard library might apply magic which makes <code>strcpy</code> faster than a naive char-by-char implementation.</p>
  
  <p>So, what is the best method to <code>strcpy</code> and receive the number of copied characters without traversing the string again?</p>