finish the bonus just need to verify some files i guess

This commit is contained in:
Maoake Teriierooiterai
2026-01-14 10:22:15 +01:00
parent fe69eeb821
commit 68dbe33733
18 changed files with 116 additions and 60 deletions

View File

@@ -0,0 +1,44 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* verif_is_digit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/09 10:25:23 by mteriier #+# #+# */
/* Updated: 2026/01/09 10:25:24 by mteriier ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "parsing.h"
int scan_str_is_digit(char *tab)
{
int i;
i = 0;
while (tab[i])
{
if ((tab[i] == '+' || tab[i] == '-') && ft_isdigit(tab[i + 1])
&& tab[i + 1])
i++;
if (!ft_isdigit(tab[i]))
return (0);
i++;
}
return (1);
}
int verif_is_digit(char **tab, int mod)
{
int i;
i = wich_mod(mod);
while (tab[i])
{
if (!scan_str_is_digit(tab[i]))
return (0);
i++;
}
return (1);
}