-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype.c
40 lines (37 loc) · 1.32 KB
/
type.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
36
37
38
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* type.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: atabiti <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/27 10:08:12 by atabiti #+# #+# */
/* Updated: 2021/12/07 09:55:42 by atabiti ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int type(char s1, va_list holde)
{
int i;
i = 0;
if (s1 == '%')
{
ft_putchar_fd('%');
return (1);
}
if (s1 == 'p')
i = pcase(holde);
else if (s1 == 'c')
i = character(holde);
else if (s1 == 's')
i = string(holde);
else if (s1 == 'd' || s1 == 'i')
i = numberd(holde);
else if (s1 == 'u')
i = numberdu(holde);
else if (s1 == 'x')
i = hexadilower(holde);
else if (s1 == 'X')
i = hexadi(holde);
return (i);
}