added finished algorithm
merged algorithm from other personnal repo
This commit is contained in:
24
libft/srcs/ft_putnbrpad.c
Normal file
24
libft/srcs/ft_putnbrpad.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_putnbrpad.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/07/31 13:51:17 by tmaze #+# #+# */
|
||||
/* Updated: 2018/07/31 14:04:43 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void ft_putnbrpad(int nbr, size_t size, char pad, char align)
|
||||
{
|
||||
if (align == 'd')
|
||||
while (size-- != 0)
|
||||
ft_putchar(pad);
|
||||
ft_putnbr(nbr);
|
||||
if (align == 'g')
|
||||
while (size-- != 0)
|
||||
ft_putchar(pad);
|
||||
}
|
Reference in New Issue
Block a user