-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf.c
More file actions
36 lines (33 loc) · 1.19 KB
/
ft_printf.c
File metadata and controls
36 lines (33 loc) · 1.19 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: slepetit <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/28 14:51:48 by slepetit #+# #+# */
/* Updated: 2022/04/28 22:44:55 by slepetit ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printf(const char *type, ...)
{
va_list li;
int i;
int size;
i = 0;
size = 0;
va_start(li, type);
while (type[i])
{
if (type[i] == '%')
{
size += ft_type(type[++i], li);
i++;
}
else if (type[i] != '%')
size += ft_putchar(type[i++]);
}
va_end(li);
return (size);
}