[<<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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson