diff --git a/Makefile b/Makefile index 3e0e64d..da398f7 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: tmaze +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2018/04/04 10:51:59 by tmaze #+# #+# # -# Updated: 2018/04/07 00:38:15 by tmaze ### ########.fr # +# Updated: 2018/04/07 11:22:24 by tmaze ### ########.fr # # # #******************************************************************************# @@ -49,7 +49,8 @@ SRCS = \ ft_memdel.c \ ft_strnew.c \ ft_strdel.c \ - ft_strclr.c + ft_strclr.c \ + ft_striter.c OBJS = $(SRCS:.c=.o) INCLS = -I. diff --git a/ft_striter.c b/ft_striter.c new file mode 100644 index 0000000..3b4a5c6 --- /dev/null +++ b/ft_striter.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_striter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: tmaze +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2018/04/07 11:17:26 by tmaze #+# #+# */ +/* Updated: 2018/04/07 11:20:40 by tmaze ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_striter(char *s, void (*f)(char*)) +{ + int i; + + i = 0; + while (s[i]) + (*f)(&s[i++]); +}