forked from nicolas-arnaud/Minishell
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.0 KiB
27 lines
1.0 KiB
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_striteri.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2021/10/20 16:23:41 by narnaud #+# #+# */
|
|
/* Updated: 2022/03/24 09:22:49 by narnaud ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "../libft.h"
|
|
|
|
void ft_striteri(char *s, void (*f)(unsigned int, char*))
|
|
{
|
|
unsigned int i;
|
|
|
|
i = 0;
|
|
if (!s || !f)
|
|
return ;
|
|
while (s[i])
|
|
{
|
|
f(i, s + i);
|
|
i++;
|
|
}
|
|
}
|
|
|