Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C - <b>strcpy() copy one string to another</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
strcpy()                 Copy One String to Another

 #include   <string.h>                   Required for declarations only

 char       *strcpy(string1,string2);
 char       *string1;                    Destination string
 char       *string2;                    Source string

    strcpy() copies the contents of 'string2' to 'string1'. The
    terminating null character ('\0') is also copied.

    Returns:    A pointer to 'string1'.

      Notes:    strcpy() expects to operate on null-terminated strings.
                No overflow checking is done when strings are copied or
                appended.

  -------------------------------- Example ---------------------------------

    This example copies the string "SUMMARY" into 'str1'.

         #include <string.h>

         char str1[25];

         main()
         {
                strcpy(str1,"SUMMARY");
         }

See Also: strncpy()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson