title: Strcpy implementation in C
body: <p>So, I have seen this <code>strcpy</code> implementation in C:</p>
  
  <pre><code>void strcpy1(char dest[], const char source[])
  {
      int i = 0;
      while (1)
      {
          dest[i] = source[i];
  
          if (dest[i] == '\0')
          {
              break;
          }
  
          i++;
      } 
  }
  </code></pre>
  
  <p>Which to me, it even copies the <code>\0</code> from source to destination.</p>
  
  <p>And I have also seen this version:</p>
  
  <pre><code>// Move the assignment into the test
  void strcpy2(char dest[], const char source[]) 
  {
      int i = 0;
      while ((dest[i] = source[i]) != '\0')
      {
          i++;
      } 
  }
  </code></pre>
  
  <p>Which to me, it will break when trying to assign <code>\0</code> from <code>source</code> to <code>dest</code>.</p>
  
  <p>What would be the correct option, copying <code>\0</code> or not?</p>