From ad3ab63c0fb602cb63d203adea0473c09cd4426e Mon Sep 17 00:00:00 2001 From: vSKAH Date: Sat, 28 Oct 2023 07:24:41 +0200 Subject: [PATCH] Add:(vSKAH): ft_str_tab_len --- Makefile | 1 + ft_str_tab_len.c | 23 +++++++++++++++++++++++ libft.h | 1 + 3 files changed, 25 insertions(+) create mode 100644 ft_str_tab_len.c diff --git a/Makefile b/Makefile index 1928645..3cea150 100755 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ SRCS = \ ft_lstclear.c \ ft_lstiter.c \ ft_base.c \ + ft_str_tab_len.c \ get_next_line.c \ get_next_line_utils.c \ ft_printf/ft_printf.c \ diff --git a/ft_str_tab_len.c b/ft_str_tab_len.c new file mode 100644 index 0000000..5c79386 --- /dev/null +++ b/ft_str_tab_len.c @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* fr_tablen.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jbadaire +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/10/28 02:17:59 by jbadaire #+# #+# */ +/* Updated: 2023/10/28 02:17:59 by jbadaire ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +size_t ft_str_tab_len(char **tab) +{ + size_t index; + + index = 0; + while (tab[index]) + index++; + return (index); +} \ No newline at end of file diff --git a/libft.h b/libft.h index 68aabab..8e67d47 100644 --- a/libft.h +++ b/libft.h @@ -41,6 +41,7 @@ int ft_putstr_fd(char *s, int fd); size_t ft_strlen(const char *s); size_t ft_strlcat(char *dst, const char *src, size_t size); size_t ft_strlcpy(char *dst, const char *src, size_t size); +size_t ft_str_tab_len(char **tab); void *ft_memset(void *s, int c, size_t n); void *ft_memmove(void *dest, const void *src, size_t n);