aboutsummaryrefslogtreecommitdiff
path: root/ft_striteri.c
diff options
context:
space:
mode:
Diffstat (limited to 'ft_striteri.c')
-rw-r--r--ft_striteri.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ft_striteri.c b/ft_striteri.c
new file mode 100644
index 0000000..305138f
--- /dev/null
+++ b/ft_striteri.c
@@ -0,0 +1,11 @@
+void ft_striteri(char *s, void (*f)(unsigned int, char *))
+{
+ unsigned int i;
+
+ i = 0;
+ while (s[i])
+ {
+ (*f)(i, &s[i]);
+ i++;
+ }
+}