Files
ft_printf/libftprintf/ft_vprintf_percent.c

33 lines
1.4 KiB
C
Raw Normal View History

2022-04-13 08:01:46 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_vprintf_percent.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:55:58 by gbaconni #+# #+# */
/* Updated: 2022/04/17 22:40:01 by gbaconni ### lausanne.ch */
2022-04-13 08:01:46 +02:00
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_vprintf_percent(const char *format, va_list ap)
{
int ret;
if (*format == '%')
ret = ft_vprintf_other(format, ap);
else if (*format == 'c')
ret = ft_vprintf_char(format, ap);
else if (*format == 's')
ret = ft_vprintf_string(format, ap);
else if (*format == 'p')
ret = ft_vprintf_pointer(format, ap);
else if (*format == 'd' || *format == 'i' || *format == 'u')
ret = ft_vprintf_decimal(format, ap);
else if (*format == 'x' || *format == 'X')
ret = ft_vprintf_hexadecimal(format, ap);
2022-04-13 08:01:46 +02:00
return (ret);
}