aboutsummaryrefslogtreecommitdiff
path: root/c11/ex02/ft_any.c
blob: ee09b410fdb415fa282e5c58096ee65ab92da62c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_any.c                                           :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: cacharle <charles.cabergs@gmail.com>       +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2019/07/16 21:23:26 by cacharle          #+#    #+#             */
/*   Updated: 2019/07/18 11:03:40 by cacharle         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include <stdlib.h>

int	ft_any(char **tab, int (*f)(char*))
{
	while (*tab != NULL)
		if ((*f)(*tab++))
			return (1);
	return (0);
}