-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putendl_fd.c
33 lines (30 loc) · 1.18 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putendl_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: geonwkim <geonwkim@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/19 14:55:24 by geonwkim #+# #+# */
/* Updated: 2024/04/22 14:07:24 by geonwkim ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putendl_fd(char *str, int fd)
{
if (!str)
return ;
while (*str)
{
write(fd, str, 1);
str++;
}
write(fd, "\n", 1);
}
// int main()
// {
// char *message = "Hello, World!";
// ft_putendl_fd(message, 1);
// ft_putendl_fd("Goodbye, World!", 2);
// return (0);
// }