-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_striteri.c
More file actions
34 lines (31 loc) · 1.34 KB
/
ft_striteri.c
File metadata and controls
34 lines (31 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jowagner <jowagner@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/29 15:28:13 by jowagner #+# #+# */
/* Updated: 2024/12/12 19:49:51 by jowagner ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Applies a function to each character of a string,
* modifying the string in place.
*
* @param s The string to iterate over and modify.
* @param f The function to apply to each character.
* Takes the index of the character and a pointer to the character.
* @return Nothing. The string is modified directly.
*/
void ft_striteri(char *s, void (*f)(unsigned int, char *))
{
unsigned int i;
i = 0;
while (s[i])
{
f(i, &s[i]);
i++;
}
}