-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf_cs.c
27 lines (24 loc) · 1.09 KB
/
ft_printf_cs.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_cs.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hdescamp <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/18 11:06:46 by hdescamp #+# #+# */
/* Updated: 2024/11/20 09:45:55 by hdescamp ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void ft_printf_c(char c, size_t *count)
{
write(1, &c, 1);
(*count)++;
}
void ft_printf_s(char *str, size_t *count)
{
if (!str)
str = "(null)";
while (*str)
ft_printf_c(*str++, count);
}