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");
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster