-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf.c
37 lines (34 loc) · 1.17 KB
/
ft_printf.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fdi-cecc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/07 09:36:36 by fdi-cecc #+# #+# */
/* Updated: 2024/05/17 10:03:42 by fdi-cecc ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printf(const char *str, ...)
{
va_list args;
int i;
int len;
i = 0;
len = 0;
va_start(args, str);
while (str[i])
{
if (str[i] == '%')
len += ft_parse(str, &args, &i);
else
{
ft_putchar(str[i]);
len++;
}
i++;
}
va_end (args);
return (len);
}