minus and 0 flags WIP

This commit is contained in:
David Gailleton
2025-11-19 21:02:04 +01:00
parent 66878549eb
commit bd1c66d86f
15 changed files with 317 additions and 57 deletions

30
bonus/ft_main_arg_bonus.c Normal file
View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_main_arg.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/19 15:38:58 by dgaillet #+# #+# */
/* Updated: 2025/11/19 15:45:26 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
static int is_main_arg(char c)
{
if (c == 'c' || c == 's' || c == 'p' || c == 'd'
|| c == 'i' || c == 'u' || c == 'x' || c == 'X' || c == '%')
return (1);
return (0);
}
char ft_main_arg(char *str)
{
while (*str)
{
if (is_main_arg(*str))
break ;
str++;
}
return (*str);
}