| 12345678910111213141516171819202122232425262728 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_isnum.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2016/07/20 14:23:27 by bchanot #+# #+# */
- /* Updated: 2017/04/15 00:34:13 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- int ft_isnum(const char *s)
- {
- if (*s == '+' || *s == '-')
- s++;
- if (*s == '\0')
- return (false);
- while (*s)
- {
- if (!ft_isdigit(*s))
- return (false);
- s++;
- }
- return (true);
- }
|