/ libft / ft_striteri.c
ft_striteri.c
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   ft_striteri.c                                      :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: gychoi <marvin@42.fr>                      +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2022/07/11 18:45:52 by gychoi            #+#    #+#             */
 9  /*   Updated: 2022/07/16 15:39:49 by gychoi           ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #include "libft.h"
14  
15  void	ft_striteri(char *s, void (*f)(unsigned int, char*))
16  {
17  	unsigned int	i;
18  
19  	if (!s || !f)
20  		return ;
21  	i = 0;
22  	while (s[i] != '\0')
23  	{
24  		f(i, &s[i]);
25  		i++;
26  	}
27  }