push
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_sorting.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: lfirmin <[email protected]> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/06/19 04:56:45 by lfirmin #+# #+# */
|
||||
/* Updated: 2024/06/19 07:51:17 by lfirmin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
#include "ftprintf.h"
|
||||
|
||||
int ft_sorting(va_list list, const char str, int fd)
|
||||
{
|
||||
int count;
|
||||
|
||||
count = 0;
|
||||
if (str == 'c')
|
||||
count += ft_printchar(fd, va_arg(list, int));
|
||||
else if (str == 's')
|
||||
count += ft_printstr(fd, va_arg(list, char *));
|
||||
else if (str == 'p')
|
||||
count += ft_print_ptr(fd, va_arg(list, unsigned long long));
|
||||
else if (str == 'd' || str == 'i')
|
||||
count += ft_print_nbr(fd, va_arg(list, int));
|
||||
else if (str == 'u')
|
||||
count += ft_print_unsigned(fd, va_arg(list, unsigned int));
|
||||
else if (str == 'x' || str == 'X')
|
||||
count += ft_print_ith(fd, va_arg(list, unsigned int), str);
|
||||
else if (str == '%')
|
||||
count += ft_printpercent(fd);
|
||||
return (count);
|
||||
}
|
||||
Reference in New Issue
Block a user