From 300d28bfe43be48c761b7579b48d0c65694f7f71 Mon Sep 17 00:00:00 2001 From: Amanda Puchille pinha Date: Mon, 9 Dec 2019 13:41:19 -0300 Subject: [PATCH] C Piscine C 01 - OK 100% 2019-11-23 --- c_piscine_c_01/ex06/ft_strlen.c | 17 ++++++++--------- c_piscine_c_01/ex06/t_a.out | Bin 8472 -> 8472 bytes c_piscine_c_01/ex06/t_main.c | 5 +---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/c_piscine_c_01/ex06/ft_strlen.c b/c_piscine_c_01/ex06/ft_strlen.c index b34d541..c61248e 100644 --- a/c_piscine_c_01/ex06/ft_strlen.c +++ b/c_piscine_c_01/ex06/ft_strlen.c @@ -3,22 +3,21 @@ /* ::: :::::::: */ /* ft_strlen.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: apuchill +#+ +:+ +#+ */ +/* By: apuchill +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/11/25 23:48:44 by apuchill #+# #+# */ -/* Updated: 2019/11/25 23:48:47 by apuchill ### ########.fr */ +/* Updated: 2019/12/05 23:12:08 by apuchill ### ########.fr */ /* */ /* ************************************************************************** */ int ft_strlen(char *str) { - int counter; + int c; - counter = 0; - while (*str != '\0') + c = 0; + while (str[c] != '\0') { - counter++; - str++; + c++; } - return (counter); -} + return (c); +} \ No newline at end of file diff --git a/c_piscine_c_01/ex06/t_a.out b/c_piscine_c_01/ex06/t_a.out index 4bf7f1e0a9cdb398700ccc77bb5636c943f9b25f..9e9476c9eb45c484360965a91a24df8c15c8cd8f 100755 GIT binary patch delta 289 zcmbQ?G{b4a4aWY7H{Asr_!$@&85kJYfEWZCCL1!^3wA(7r67U~9g`b@qKlxS+)&X) zlP>~AH$X)_prRW#D>Csj2^c;9EwK59?YmW1{=8G_ajxF%z;c+Y-Xq!f3;#Y5j^9nh!8`x_)_i_y7O@Kwj+O2`~`q(fQP)`Hg@_Z|%=+)&!vHPS>Al-Mmpi zR$8a;-!9Q0Agd$v|BFdLy+AX%OTT#Z+S&mHH!!>anQr*4)Ad8=2ao0>0zh;Bs|s}i n1sNE8dSxqtlw-L@M%-jo~uwL8jz;c+Yo_`-l^G^o;7LdW+ zu3wrDFm}3r@#yyb;n94M(WBG%$IEN~|NjTd#2%h7A=IPusYml01&?0WpWVC}KrNlV zKhwHJlYp$W&d|ROU8a#hrb9>Re~(Vr4<6mMA6|3-wRgI{=`MZa(Q9i1l-