-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf.c
31 lines (28 loc) · 1.24 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vrodrigo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/13 16:45:05 by vrodrigo #+# #+# */
/* Updated: 2020/03/04 19:28:35 by vrodrigo ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include "ft_printf.h"
int ft_printf(const char *format, ...)
{
t_data_args *list;
if (!(list = (t_data_args*)malloc(sizeof(t_data_args))))
return (-1);
list->format = format;
list->i = 0;
list->len = 0;
reinicialice(list);
va_start(list->args, format);
list->len = data_display(list);
va_end(list->args);
free(list);
return (list->len);
}