-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_conv_specifies.c
47 lines (40 loc) · 1.35 KB
/
ft_conv_specifies.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
41
42
43
44
45
46
47
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_conv_specifies.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: shmoreno <shmoreno@student.42lausanne.c +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/13 14:54:11 by shmoreno #+# #+# */
/* Updated: 2024/03/17 19:16:52 by shmoreno ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
//The functions in this folder are the specifies conversions for printf.
int ft_conv_char(va_list ac)
{
char c;
c = va_arg(ac, int);
return (write(1, &c, 1));
}
int ft_conv_string(va_list cv)
{
char *str;
size_t i;
i = 0;
str = va_arg(cv, char *);
if (!str)
write(1, "(null)\n", 7);
while (str[i] != '\0')
{
write(1, &str[i], 1);
i++;
}
return (i);
}
int ft_conv_pointer(va_list cp)
{
void *ptr;
ptr = va_arg(cp, void *);
return (0);
}