-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf.c
More file actions
40 lines (37 loc) · 1.21 KB
/
ft_printf.c
File metadata and controls
40 lines (37 loc) · 1.21 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cescobio <cescobio@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/06 12:07:00 by cescobio #+# #+# */
/* Updated: 2026/02/11 11:51:50 by cescobio ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printf(char const *format, ...)
{
va_list args;
int i;
int count;
va_start(args, format);
i = 0;
count = 0;
while (format[i])
{
if (format[i] == '%')
{
i++;
count += ft_format(format[i], args);
}
else
{
write(1, &format[i], 1);
count++;
}
i++;
}
va_end(args);
return (count);
}