Add initial code
This commit is contained in:
34
libftprintf/libft/ft_strlen.c
Normal file
34
libftprintf/libft/ft_strlen.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlen.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/10/11 14:35:03 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/10/24 13:11:12 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
size_t ft_strlen(const char *s)
|
||||
{
|
||||
const char *str;
|
||||
|
||||
str = s;
|
||||
while (*str != '\0')
|
||||
str++;
|
||||
return (str - s);
|
||||
}
|
||||
/*
|
||||
size_t ft_strlen(const char *s)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
len = 0;
|
||||
while (s[len] != '\0')
|
||||
len++;
|
||||
return (len);
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user