ft_striteri.c 1.1 KB

12345678910111213141516171819202122232425262728
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_striteri.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2015/11/25 19:02:58 by bchanot #+# #+# */
  9. /* Updated: 2015/12/07 15:28:05 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "libft.h"
  13. void ft_striteri(char *s, void (*f)(unsigned int, char *))
  14. {
  15. unsigned int cpt;
  16. cpt = 0;
  17. if (s && f)
  18. {
  19. while (s[cpt])
  20. {
  21. (*f)(cpt, &s[cpt]);
  22. cpt++;
  23. }
  24. }
  25. }