ft_striteri
Subject
Understandable explanation
ft_striteri
works the same way as ft_strmapi
does, take a look at the explanation for ft_strmapi
and then come back here.
The difference between ft_striteri
and ft_strmapi
is that ft_striteri
doesn't return anything and works directly on the original string.
Hints
This functions takes two parameters, the first one is a string, and the second one is a function.
What ft_striteri
does is apply the function f
to every character of the string s
.
It passes the index of the character in the string, and a pointer to the character to the function f
.
The function f
directly modifies the value of the character in the original string.
At the end, we don't need to return anything but the original string will have been modified.
Commented solution
Last updated