base struct
This commit is contained in:
24
lib/libft/srcs/str/ft_striteri.c
Normal file
24
lib/libft/srcs/str/ft_striteri.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_striteri.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/15 17:17:33 by nalebrun #+# #+# */
|
||||
/* Updated: 2024/11/25 16:16:05 by nalebrun ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../libft.h"
|
||||
|
||||
void ft_striteri(char *s, void (*f)(unsigned int, char *))
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!s || !f)
|
||||
return ;
|
||||
i = -1;
|
||||
while (s[++i])
|
||||
f(i, &s[i]);
|
||||
}
|
||||
Reference in New Issue
Block a user