/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_count_if.c                                      :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: jayang <[email protected]>                      +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2022/02/17 08:36:33 by jayang            #+#    #+#             */
/*   Updated: 2022/02/17 20:51:51 by jayang           ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

int	ft_count_if(char **tab, int length, int(*f)(char *))
{
	int	idx;
	int	cnt;

	idx = 0;
	cnt = 0;
	while (idx < length)
	{
		if (f(tab[idx]) != 0)
			cnt++;
		idx++;
	}
	return (cnt);
}