/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strdup.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cchauvet char *ft_strcpy(char *dest, char *src) { int i; i = 0; while (src[i] != 0) { dest[i] = src[i]; i++; } return (dest); } unsigned int ft_strlen(char *str) { unsigned int i; i = 0; while (str[i] != 0) i++; return (i); } char *ft_strdup(char *src) { char *dest; dest = malloc(sizeof(src) * ft_strlen(src)); ft_strcpy(dest, src); return (dest); }