title: Reproduce the behaviour of strcpy
body: <p>I'm trying to reproduce the behaviour of <code>strcpy</code> in c, my problem is that the function works but it append extra stuff at the end.</p>
  
  <pre><code>char    *ft_strcpy(char * dst, const char * src)
  {
  int i;
  i = 0;
  while (src[i] != '\0') {
      dst[i] = src[i];
      i++;
  }
  return dst;
  }
  </code></pre>
  
  <p>When i run it I get the following.</p>
  
  <pre><code>int main()
  {
  char p[] = {};
  char z[] = "Hello World";
  ft_strcpy(p,z);
  printf("%s\n", p);
  return 0;
  }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/fvr8R.png" rel="nofollow">function results</a></p>