-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putendl_fd.c
25 lines (21 loc) · 1.15 KB
/
ft_putendl_fd.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putendl_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbrito-p <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/08 20:26:51 by mbrito-p #+# #+# */
/* Updated: 2023/05/08 20:26:51 by mbrito-p ### ########.fr */
/* */
/* ************************************************************************** */
// Outputs the string ’s’ to the given file descriptor
// followed by a newline.
#include "libft.h"
void ft_putendl_fd(char *s, int fd)
{
size_t len;
len = ft_strlen(s);
write(fd, s, len);
write(fd, "\n", 1); //it has to be the same file description
}