/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strcpy.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tischmid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/19 05:59:56 by tischmid #+# #+# */ /* Updated: 2023/03/24 01:29:58 by tischmid ### ########.fr */ /* */ /* ************************************************************************** */ char *ft_strcpy(char *s1, char *s2) { int i; i = -1; while (s2[++i] != '\0') s1[i] = s2[i]; s1[i] = '\0'; return (s1); } /* //// #include #define BUFSIZE 10 #define STR "||||||||||" int main(void) { int arrlen = 4; char *teststrings[] = {"", "h", "he", "hey"}; char buf[BUFSIZE] = STR; for (int j = 0; j < arrlen; ++j) { printf("####### Element == '%s' #######\n", teststrings[j]); ft_strcpy(buf, teststrings[j]); for (int i = 0; i < BUFSIZE; ++i) printf((buf[i] >= 32 && buf[i] <= 126) ? "%c\n" : "0x%x\n", buf[i]); } return (0); } */ ////