42_solong/libftx/printf/ft_dprintstrtab.c

30 lines
1.1 KiB
C
Raw Permalink Normal View History

2023-01-05 13:04:29 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_dprintstrtab.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/05 17:26:55 by cchauvet #+# #+# */
/* Updated: 2023/01/05 18:52:56 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_dprintstrtab(int fd, char **tab)
{
size_t index;
int i;
i = 0;
index = 0;
while (tab[index] != NULL)
{
i += ft_putstr_fd(fd, tab[index]) + 1;
ft_putchar_fd(fd, '\n');
index++;
}
return (i);
}