-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_c.c
33 lines (28 loc) · 1.17 KB
/
ft_c.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_c.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: acuva-nu <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/24 13:05:09 by acuva-nu #+# #+# */
/* Updated: 2024/02/24 13:05:09 by acuva-nu ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_c(int c)
{
write(1, &c, 1);
return (1);
}
int ft_prntc(int c, t_options opts)
{
int size;
size = 0;
if (opts.left == 1)
size += ft_c(c);
size += opt_pad(opts.width, 1, opts.zero);
if (opts.left == 0)
size += ft_c(c);
return (size);
}