-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printf_utils.c
43 lines (38 loc) · 1.18 KB
/
ft_printf_utils.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
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: juhtoo-h <juhtoo-h@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/04 07:59:18 by juhtoo-h #+# #+# */
/* Updated: 2024/09/04 16:30:52 by juhtoo-h ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putchar(int c)
{
write(1, &c, 1);
return (1);
}
int ft_putstr(char *str)
{
int i;
i = 0;
if (str == NULL)
{
write(1, "(null)", 6);
return (6);
}
while (str[i])
{
write(1, &str[i], 1);
i++;
}
return (i);
}
int ft_putpercent(void)
{
write(1, "%", 1);
return (1);
}