-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf.c
35 lines (32 loc) · 1.19 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
32
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mpernia- <mpernia-@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/12/05 03:05:51 by mpernia- #+# #+# */
/* Updated: 2020/01/19 18:43:51 by mpernia- ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
#include "libft/libft.h"
int ft_printf(const char *s, ...)
{
va_list args;
t_case *head;
t_case *aux;
int i;
head = create_list(s);
aux = head;
va_start(args, s);
i = 0;
while (aux)
{
i += check_to_print(aux, args);
aux = aux->next;
}
va_end(args);
free_list(&head);
return (i);
}