strcpy

Copies a string into an array (function or macro)

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:String Manipulation

Syntax

  #include <string.h>  
   
  char *strcpy  (  
     char         *dst,   
     const char   *src);
  

Parameters

dst
(OUT) Points to the array into which to copy the string.
src
(IN) Points to the string to be copied.

Return Values

strcpy returns the address of dst.

Remarks

The strcpy function or macro copies the string pointed to by src (including the terminating NULL character) into the array pointed to by dst. Copying of overlapping objects is not guaranteed to work properly. See the description for the memmove function to copy objects that overlap.

See Also

memmove, strncpy

Example

  #include <string.h>  
  main ()  
  {  
     char    buffer[80];  
     strcpy (buffer, "Hello ");  
  }