ft_striter
This commit is contained in:
parent
c1fa649a7f
commit
1cb14a826a
5
Makefile
5
Makefile
@ -6,7 +6,7 @@
|
|||||||
# By: tmaze <marvin@42.fr> +#+ +:+ +#+ #
|
# By: tmaze <marvin@42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2018/04/04 10:51:59 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_memdel.c \
|
||||||
ft_strnew.c \
|
ft_strnew.c \
|
||||||
ft_strdel.c \
|
ft_strdel.c \
|
||||||
ft_strclr.c
|
ft_strclr.c \
|
||||||
|
ft_striter.c
|
||||||
OBJS = $(SRCS:.c=.o)
|
OBJS = $(SRCS:.c=.o)
|
||||||
INCLS = -I.
|
INCLS = -I.
|
||||||
|
|
||||||
|
22
ft_striter.c
Normal file
22
ft_striter.c
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_striter.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: tmaze <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* 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++]);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user