Skip to content

Commit

Permalink
C Piscine C 01 - OK 100% 2019-11-23
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanda Puchille pinha committed Dec 9, 2019
1 parent 9ee343f commit 300d28b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
17 changes: 8 additions & 9 deletions c_piscine_c_01/ex06/ft_strlen.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apuchill <marvin@42.fr> +#+ +:+ +#+ */
/* By: apuchill <apuchill@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
}
Binary file modified c_piscine_c_01/ex06/t_a.out
Binary file not shown.
5 changes: 1 addition & 4 deletions c_piscine_c_01/ex06/t_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ int ft_strlen(char *str);
int main (void)
{
char str[] = "Amanda";
char *p_str;

p_str = str;

int count = ft_strlen(p_str);
int count = ft_strlen(str);

printf("%d\n", count);
}

0 comments on commit 300d28b

Please sign in to comment.