-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_putendl_fd.c
35 lines (32 loc) · 1.26 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
26
27
28
29
30
31
32
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putendl_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cjackows <cjackows@student.42wolfsburg. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/12 17:18:15 by cjackows #+# #+# */
/* Updated: 2022/06/16 17:33:54 by cjackows ### ########.fr */
/* */
/* ************************************************************************** */
#include "../inc/libft.h"
/**
* @brief Pass the string "s" to the given file descriptor
* followed by a newline.
* @param s Passed string
* @param fd File descriptor
*/
void ft_putendl_fd(char *s, int fd)
{
if (s || fd >= 0)
{
write(fd, s, ft_strlen(s));
write(fd, "\n", 1);
}
}
// int main ()
// {
// char str[] = "Hello World!";
// ft_putendl_fd(str, 1);
// return (0);
// }