-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_c.c
31 lines (27 loc) · 1.15 KB
/
print_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_c.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jilai <jilai@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/04 20:01:17 by jilai #+# #+# */
/* Updated: 2024/04/04 20:01:19 by jilai ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int print_c(int c, t_fopt *opt)
{
int len;
len = 0;
if (opt->left == 1)
len += print_char(c);
len += put_spa_zer(opt->width, 1, opt->zero);
if (opt->left == 0)
len += print_char(c);
return (len);
}
int print_char(int c)
{
return (write (1, &c, 1));
}