-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf.c
More file actions
35 lines (32 loc) · 1.13 KB
/
ft_printf.c
File metadata and controls
35 lines (32 loc) · 1.13 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: halhashm <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/16 15:35:27 by halhashm #+# #+# */
/* Updated: 2021/11/17 12:34:33 by halhashm ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_printf(const char *c, ...)
{
va_list arg;
int i;
i = 0;
va_start(arg, c);
while (*c != '\0')
{
if (*c == '%')
{
c++;
i += ft_printf_dt(c, arg);
}
else
ft_putchar(*c, &i);
c++;
}
va_end(arg);
return (i);
}