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.5 KiB
47 lines
1.5 KiB
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_putx.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2021/10/27 09:54:24 by narnaud #+# #+# */
|
|
/* Updated: 2021/11/17 10:24:24 by narnaud ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_printf.h"
|
|
|
|
int ft_putx(unsigned int n)
|
|
{
|
|
char *str;
|
|
int ret;
|
|
|
|
str = ft_itox((unsigned long int)n, "0123456789abcdef");
|
|
ret = ft_putstr(str);
|
|
free(str);
|
|
return (ret);
|
|
}
|
|
|
|
int ft_putx_cap(unsigned int n)
|
|
{
|
|
char *str;
|
|
int ret;
|
|
|
|
str = ft_itox((unsigned long int)n, "0123456789ABCDEF");
|
|
ret = ft_putstr(str);
|
|
free(str);
|
|
return (ret);
|
|
}
|
|
|
|
int va_putx(va_list va_uint, const char *str)
|
|
{
|
|
(void)*str;
|
|
return (ft_putx(va_arg(va_uint, unsigned int)));
|
|
}
|
|
|
|
int va_putx_cap(va_list va_uint, const char *str)
|
|
{
|
|
(void)*str;
|
|
return (ft_putx_cap(va_arg(va_uint, unsigned int)));
|
|
}
|
|
|