-
Notifications
You must be signed in to change notification settings - Fork 0
/
is.c
37 lines (33 loc) · 1.26 KB
/
is.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* is.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: monoue <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/08/06 16:01:15 by monoue #+# #+# */
/* Updated: 2020/08/20 12:46:51 by monoue ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
bool is_of_chars(const unsigned int c, int argc, ...)
{
va_list ap;
va_start(ap, argc);
while (argc--)
{
if (va_arg(ap, unsigned int) == c)
{
va_end(ap);
return (true);
}
}
va_end(ap);
return (false);
}
bool isconversion_c(const unsigned int c)
{
if (is_of_chars(c, 9, 'c', 'd', 'i', 'x', 'X', 's', 'u', 'p', '%'))
return (true);
return (false);
}