Copying String

Learn how to copy the source string into the target string.

The strcpy() function

strcpy( ) copies the source string, str1, into the target string, str2. The basic syntax of the strcpy() function is given below:

char* strcpy(const char *str2, const char *str1);

Get hands-on with 1200+ tech skills courses.