/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strlen.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: whaffman +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/11 15:01:31 by whaffman #+# #+# */ /* Updated: 2024/06/12 11:10:18 by whaffman ### ########.fr */ /* */ /* ************************************************************************** */ #include #include int ft_strlen(char *str) { int i; i = 0; while (*str++) i++; return (i); } #ifdef DEBUG void test(char *str) { printf("str: \"%s\"\n", str); printf("strlen: %ld\n", strlen(str)); printf("ft_strlen: %d\n\n", ft_strlen(str)); } int main(void) { test("Vogon"); test(""); test("Zaphod Beeblebrox"); return (0); } #endif