Guardian C Library Calls Reference Manual

strcpy
3-196 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
strcpy
The strcpy function copies one string to another.
str1_ptr
points to the target string.
str2_ptr
points to the string to be copied.
Return Value
points to the target string; that is, the return value is str1_ptr.
Usage Guidelines
If the strings overlap, the strcpy function does not preserve data.
Example
This example copies string s2 to s1 and prints s1:
#include <stringh>
int main(void)
{
char s1[20];
char *s2;
char *s3;
s2 = "This is a string";
s3 = strcpy(s1,s2);
printf("%s",s3); /* "This is a string" */
}
#include <stringh>
char *strcpy(char *str1_ptr, const char *str2_ptr);