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

View File

@@ -1,18 +1,26 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_char.c :+: :+: :+: */
/* print_char_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/17 11:56:36 by dgaillet #+# #+# */
/* Updated: 2025/11/17 12:45:57 by dgaillet ### ########lyon.fr */
/* Updated: 2025/11/19 19:42:20 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "ft_printf_bonus.h"
#include <unistd.h>
#include <stdlib.h>
int print_char(char c)
int print_char(t_arg *arg, char c)
{
return (write(1, &c, 1));
int count;
count = 0;
if (!arg->minus && arg->zero)
count += print_chars(arg->zero - 1, ' ');
count += write(1, &c, 1);
return (count);
}