-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf.c
More file actions
38 lines (35 loc) · 1.2 KB
/
ft_printf.c
File metadata and controls
38 lines (35 loc) · 1.2 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mikkayma <mikkayma@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/30 10:37:08 by mikkayma #+# #+# */
/* Updated: 2024/10/30 10:37:08 by mikkayma ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printf(const char *format, ...)
{
va_list args;
int caunt;
caunt = 0;
va_start(args, format);
while (*format)
{
if (*format == '%')
{
format++;
caunt += ft_format(*format, args);
}
else
{
caunt++;
write(1, format, 1);
}
format++;
}
va_end(args);
return (caunt);
}