tgrekov-libft
HIVE libft Oct 2023
Loading...
Searching...
No Matches
ft_striteri.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_striteri.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2023/10/28 00:00:09 by tgrekov #+# #+# */
9
/* Updated: 2023/11/15 23:40:30 by tgrekov ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
20
#include "
libft.h
"
21
31
void
ft_striteri
(
char
*s,
void
(*f)(
unsigned
int
,
char
*))
32
{
33
unsigned
int
len;
34
35
if
(!s || !f)
36
return ;
37
len =
ft_strlen
(s);
38
while
(len--)
39
f(len, s + len);
40
}
ft_striteri
void ft_striteri(char *s, void(*f)(unsigned int, char *))
Applies function f to each character of string s.
Definition
ft_striteri.c:31
ft_strlen
size_t ft_strlen(const char *str)
Get length of str.
Definition
ft_strlen.c:28
libft.h
ft_striteri.c