-
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.22 KB
/
Copy pathft_printf.c
File metadata and controls
40 lines (37 loc) · 1.22 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: mchaibi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/13 13:18:22 by mchaibi #+# #+# */
/* Updated: 2024/12/09 10:33:16 by mchaibi ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printf(const char *format, ...)
{
va_list args;
int i;
int count;
i = 0;
va_start(args, format);
count = 0;
while (format[i])
{
if (format[i] == '%')
{
i++;
count += ft_handle_format(format[i], args);
}
else
{
ft_putchar(format[i]);
count++;
}
i++;
}
va_end(args);
return (count);
}