From 67b29782ae9ee81278ed4aa818e182691af5aa25 Mon Sep 17 00:00:00 2001 From: Tanguy MAZE Date: Wed, 4 Apr 2018 15:24:09 +0200 Subject: [PATCH] ft_strlen --- Makefile | 3 ++- ft_strlen.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 ft_strlen.c diff --git a/Makefile b/Makefile index 1124304..9297378 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: tmaze +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2018/04/04 10:51:59 by tmaze #+# #+# # -# Updated: 2018/04/04 15:07:23 by tmaze ### ########.fr # +# Updated: 2018/04/04 15:08:39 by tmaze ### ########.fr # # # #******************************************************************************# @@ -17,6 +17,7 @@ CCSTD = -std=c99 NAME = libft.a SRCS = \ + ft_strlen.c \ ft_isalpha.c \ ft_isdigit.c \ ft_isalnum.c \ diff --git a/ft_strlen.c b/ft_strlen.c new file mode 100644 index 0000000..d4d52b4 --- /dev/null +++ b/ft_strlen.c @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strlen.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: tmaze +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2018/04/03 15:33:37 by tmaze #+# #+# */ +/* Updated: 2018/04/04 14:39:59 by tmaze ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +size_t ft_strlen(const char *s) +{ + int i; + + i = 0; + while (s[i]) + i++; + return (i); +}