C / string.h / strcpy
memchr, memcmp, memcpy, memmove, memset, strcat, strchr, strcmp, strcoll, » strcpy, strcspn, strerror, strlen, strncat, strncmp, strncpy, strpbrk, strrchr, strspn, strstr, strtok, strxfrm,
Funcion: strcpy()
Sintaxis:
Descripcion: Copia la cadena apuntada por s2 (incluyendo el carácter nulo) a la cadena apuntada por s1.
Ejemplo:
Sintaxis:
char *strcpy(char *s1, const char *s2);
Descripcion: Copia la cadena apuntada por s2 (incluyendo el carácter nulo) a la cadena apuntada por s1.
Ejemplo:
#include <stdio.h> #include <string.h> int main() { char s2[8] = "abcdefg"; char s1[8]; strcpy( s1, s2 ); printf( "s2=%s\n", s2 ); printf( "s1=%s\n", s1 ); return 0; }