33 lines
1.2 KiB
C
33 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_striteri.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/11/09 13:57:34 by rparodi #+# #+# */
|
|
/* Updated: 2024/10/31 18:11:04 by rparodi ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
/**
|
|
* @brief Applies a function to each character of a string.
|
|
*
|
|
* @param s The string to modify.
|
|
* @param f The function to apply to each character.
|
|
*
|
|
* @return void
|
|
*/
|
|
void ft_striteri(char *s, void (*f)(unsigned int, char*))
|
|
{
|
|
size_t i;
|
|
|
|
i = 0;
|
|
while (s[i] != '\0')
|
|
{
|
|
f(i, s + i);
|
|
i++;
|
|
}
|
|
}
|