You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_putnbrs.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2021/10/27 09:34:01 by narnaud #+# #+# */
|
|
/* Updated: 2021/12/21 10:06:28 by narnaud ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_printf.h"
|
|
|
|
int ft_putnbr(int n, const char *str)
|
|
{
|
|
char *n_str;
|
|
int ret;
|
|
|
|
(void)*str;
|
|
n_str = ft_itoa(n);
|
|
ret = ft_putstr(n_str);
|
|
free(n_str);
|
|
return (ret);
|
|
}
|
|
|
|
int ft_putunsign(unsigned int n, const char *str)
|
|
{
|
|
char *n_str;
|
|
int ret;
|
|
|
|
(void)*str;
|
|
n_str = ft_utoa(n);
|
|
ret = ft_putstr(n_str);
|
|
free(n_str);
|
|
return (ret);
|
|
}
|
|
|
|
int va_putnbr(va_list va, const char *str)
|
|
{
|
|
return (ft_putnbr(va_arg(va, int), str));
|
|
}
|
|
|
|
int va_putunsign(va_list va, const char *str)
|
|
{
|
|
return (ft_putunsign(va_arg(va, unsigned int), str));
|
|
}
|
|
|