piscine-c04/ex00/ft_strlen.c

34 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/27 00:57:16 by tischmid #+# #+# */
/* Updated: 2023/03/27 00:58:43 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strlen(char *str)
{
int i;
i = 0;
while (*str++)
++i;
return (i);
}
/* ////
#include <stdio.h>
int main(void)
{
char str[10] = "Hello";
printf("%d\n", ft_strlen(str));
return (0);
}
*/ ////