ft_striteri, ft_striter: changed int to unsigned int
This commit is contained in:
parent
1cb14a826a
commit
a3462b7b10
5
Makefile
5
Makefile
@ -6,7 +6,7 @@
|
||||
# By: tmaze <marvin@42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2018/04/04 10:51:59 by tmaze #+# #+# #
|
||||
# Updated: 2018/04/07 11:22:24 by tmaze ### ########.fr #
|
||||
# Updated: 2018/04/07 11:42:48 by tmaze ### ########.fr #
|
||||
# #
|
||||
#******************************************************************************#
|
||||
|
||||
@ -50,7 +50,8 @@ SRCS = \
|
||||
ft_strnew.c \
|
||||
ft_strdel.c \
|
||||
ft_strclr.c \
|
||||
ft_striter.c
|
||||
ft_striter.c \
|
||||
ft_striteri.c
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
INCLS = -I.
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: tmaze <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/04/07 11:17:26 by tmaze #+# #+# */
|
||||
/* Updated: 2018/04/07 11:20:40 by tmaze ### ########.fr */
|
||||
/* Updated: 2018/04/07 11:41:57 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
void ft_striter(char *s, void (*f)(char*))
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
i = 0;
|
||||
while (s[i])
|
||||
|
22
ft_striteri.c
Normal file
22
ft_striteri.c
Normal file
@ -0,0 +1,22 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_striteri.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tmaze <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/04/07 11:36:12 by tmaze #+# #+# */
|
||||
/* Updated: 2018/04/07 11:48:32 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void ft_striteri(char *s, void (*f)(unsigned int, char*))
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
i = -1;
|
||||
while (s[++i])
|
||||
(*f)(i, &s[i]);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user