2022-10-06 20:30:03 -04:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* ft_strlen.c :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2022/10/06 17:39:05 by cchauvet #+# #+# */
|
2022-10-23 13:01:50 -04:00
|
|
|
/* Updated: 2022/10/11 00:01:22 by cchauvet ### ########.fr */
|
2022-10-06 20:30:03 -04:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
2022-10-23 13:01:50 -04:00
|
|
|
#include "ft_printf.h"
|
2022-10-06 20:30:03 -04:00
|
|
|
|
|
|
|
size_t ft_strlen(const char *s)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
|
2022-10-10 13:33:47 -04:00
|
|
|
if (s == NULL)
|
|
|
|
return (0);
|
2022-10-06 20:30:03 -04:00
|
|
|
i = 0;
|
|
|
|
while (s[i])
|
|
|
|
i++;
|
|
|
|
return (i);
|
|
|
|
}
|