minus and 0 flags WIP
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user