init
This commit is contained in:
31
C/c04/ex00/ft_strlen.c
Normal file
31
C/c04/ex00/ft_strlen.c
Normal file
@ -0,0 +1,31 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlen.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/19 15:05:40 by cchauvet #+# #+# */
|
||||
/* Updated: 2022/07/19 15:05:42 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_strlen(char *str)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (str[i] != 0)
|
||||
i++;
|
||||
return (i);
|
||||
}
|
||||
|
||||
/*
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("%d", ft_strlen("123456789"));
|
||||
printf("%d", ft_strlen(""));
|
||||
}
|
||||
*/
|
Reference in New Issue
Block a user