-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_is_pos_integer.c
More file actions
24 lines (22 loc) · 1.13 KB
/
Copy pathft_is_pos_integer.c
File metadata and controls
24 lines (22 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_is_pos_integer.c :+: :+: */
/* +:+ */
/* By: cherrewi <cherrewi@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2023/04/21 13:34:47 by cherrewi #+# #+# */
/* Updated: 2023/08/01 17:52:59 by cherrewi ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
check if string has format:
optionally starts with a plus '+' or minus '-' sign
only consists of digits [0-9]
is within range [1, INT_MAX]
*/
bool ft_is_pos_integer(char *int_str)
{
return (ft_isinteger(int_str) && ft_atoi(int_str) > 0);
}