Bonus preparartion
This commit is contained in:
25
bonus/print_pointer_bonus.c
Normal file
25
bonus/print_pointer_bonus.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* print_pointer_bonus.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/17 12:19:16 by dgaillet #+# #+# */
|
||||
/* Updated: 2025/11/19 13:35:58 by dgaillet ### ########lyon.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "ft_printf_bonus.h"
|
||||
|
||||
int print_pointer(unsigned long long p)
|
||||
{
|
||||
if (!p)
|
||||
{
|
||||
ft_putstr_fd("(nil)", 1);
|
||||
return (5);
|
||||
}
|
||||
ft_putstr_fd("0x", 1);
|
||||
return (2 + ft_putnbr_base(p, "0123456789abcdef", 16));
|
||||
}
|
||||
Reference in New Issue
Block a user