-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_striteri.c
49 lines (43 loc) · 1.47 KB
/
ft_striteri.c
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: duzun <davut@uzun.ist> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/22 02:16:08 by duzun #+# #+# */
/* Updated: 2022/11/25 23:17:39 by duzun ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
//#include <stdio.h> // main dosyası için gerekli.
// f işlevini s dizgisinin her karakterine uygular.
// herhangi bir değer döndürülmez.
void ft_striteri(char *s, void (*f)(unsigned int, char*))
{
unsigned int i;
i = 0;
if (s && *s && f)
{
while (s[i])
{
f(i, &s[i]);
i++;
}
}
}
// main başlangıcı
/*
void test_f(unsigned int i, char *str)
{
printf("İç fonsiyon index : %d değer: %s\n", i, str);
}
int main(void)
{
char str[10] = "Davut.";
printf("%s için sonuçlar\n", str);
ft_striteri(str, test_f);
printf("%s için sonuçlar\n", str);
return (0);
}
*/