-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_printf.c
28 lines (25 loc) · 1.08 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: smonroe <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/08/27 17:21:30 by smonroe #+# #+# */
/* Updated: 2018/08/27 17:22:17 by smonroe ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_printf(char *str, ...)
{
int len;
char *buf;
va_list ap;
va_start(ap, str);
buf = parse(str, ap);
len = ft_strlen(buf);
ft_putstr(buf);
free(buf);
va_end(ap);
return (len);
}