-
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.25 KB
/
ft_printf.c
File metadata and controls
40 lines (37 loc) · 1.25 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: luis-ffe <luis-ffe@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/10 20:04:02 by luis-ffe #+# #+# */
/* Updated: 2023/10/12 12:26:39 by luis-ffe ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printf(const char *input, ...)
{
int i;
va_list list;
va_start(list, input);
i = 0;
while (*input)
{
if (*input == '%')
{
input++;
if (*input != '%' && *input)
{
i += ft_typefinder(*input, list);
}
else
i += ft_putchar_fd(*input, 1);
}
else
i += ft_putchar_fd(*input, 1);
input++;
}
va_end(list);
return (i);
}