title: Implementing a new strcpy function redefines the library function strcpy?
body: <p>It is said that we can write multiple declarations but only one definition. Now if I implement my own strcpy function with the same prototype : </p>
  
  <pre><code>char * strcpy ( char * destination, const char * source );
  </code></pre>
  
  <p>Then am I not redefining the existing library function? Shouldn't this display an error? Or is it somehow related to the fact that the library functions are provided in object code form?</p>
  
  <p>EDIT: Running the following code on my machine says "Segmentation fault (core dumped)". I am working on linux and have compiled without using any flags.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  char *strcpy(char *destination, const char *source);
  
  int main(){
      char *s = strcpy("a", "b");
      printf("\nThe function ran successfully\n");
      return 0;
  }
  
  char *strcpy(char *destination, const char *source){
      printf("in duplicate function strcpy");
      return "a";
  }
  </code></pre>
  
  <p>Please note that I am not trying to implement the function. I am just trying to redefine a function and asking for the consequences.</p>
  
  <p><strong>EDIT 2:
  After applying the suggested changes by Mats, the program no longer gives a segmentation fault although I am still redefining the function.</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  char *strcpy(char *destination, const char *source);
  
  int main(){
      char *s = strcpy("a", "b");
      printf("\nThe function ran successfully\n");
      return 0;
  }
  
  char *strcpy(char *destination, const char *source){
      printf("in duplicate function strcpy");
      return "a";
  }
  </code></pre>