Código
char* mi_strcpy(char* s1, char* s2){ char* puntero = s1; while(*s2 != '\0'){ *puntero = *s2; puntero++; s2++; } *puntero = '\0'; return s1; } void test_mi_strcpy() { char* s1 = "abcdefgh"; char s2 [8]; INICIO_TEST("mi_strcpy"); DebeSerCierto(mi_strcpy(s2, s1) == "abcdefgh"); FIN_TEST("mi_strcpy"); }
· Los códigos deben ir en etiquetas GeSHi
>aquí las reglas del foro
-Engel Lex