strcpy(3) Library Functions Manual strcpy(3) strcpy strcat - (libc -lc) #include char *strcpy(char *restrict dst, const char *restrict src); char *strcat(char *restrict dst, const char *restrict src); strcpy() src dst. strlen(src) + 1. stpcpy(dst, src) dst strcat() src dst ( ). strlen(dst) + strlen(src) + 1. stpcpy(strnul(dst) src) dst dst. attributes(7). +------------+------------------------------------+--------------------+ || | | +------------+------------------------------------+--------------------+ |strcpy() | | MT-Safe | |strcat() | | | +------------+------------------------------------+--------------------+ C11, POSIX.1-2008. POSIX.1-2001 C89 SVr4 4.3BSD. src dst. . _FORTIFY_SOURCE feature_test_macros(7). strcat() . . #include #include #include #include int main(void) { char *buf1; size_t len, size; size = strlen("Hello ") + strlen("world") + strlen("!") + 1; buf1 = malloc(sizeof(*buf1) * size); if (buf1 == NULL) err(EXIT_FAILURE, "malloc()"); strcpy(buf1, "Hello "); strcat(buf1, "world"); strcat(buf1, "!"); len = strlen(buf1); printf("[len = %zu]: ", len); puts(buf1); // "Hello world!" free(buf1); exit(EXIT_SUCCESS); } stpcpy(3) strdup(3) string(3) wcscpy(3) string_copying(7) 3 . . : . 6.18 25 2026 strcpy(3)