-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf.c
More file actions
36 lines (33 loc) · 1.2 KB
/
ft_printf.c
File metadata and controls
36 lines (33 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_printf.c :+: :+: */
/* +:+ */
/* By: cstaats <cstaats@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2021/10/25 12:15:12 by cstaats #+# #+# */
/* Updated: 2021/11/24 12:56:43 by cstaats ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_printf(const char *format, ...)
{
va_list ap;
int ret;
ret = 0;
va_start(ap, format);
while (*format != '\0')
{
if (*format == '%')
{
ret += bandersnatch(format + 1, ap);
format = format + 2;
continue ;
}
write(1, format, 1);
format++;
ret++;
}
va_end(ap);
return (ret);
}