/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_cptchar.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/12/23 15:16:22 by bchanot #+# #+# */ /* Updated: 2018/10/13 20:10:40 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" size_t ft_cptchar(const char *src, char c) { size_t i; i = 0; if (!src || !c) return (0); while (*src) { if (*src == c) i++; src++; } return (i); }