-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putendl_fd.c
30 lines (25 loc) · 1.13 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putendl_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yeparra- <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/03 13:17:29 by yeparra- #+# #+# */
/* Updated: 2023/11/03 13:19:17 by yeparra- ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putendl_fd(char *s, int fd)
{
size_t len;
len = strlen(s);
write(fd, s, len);
write(fd, "\n", 1);
}
int main()
{
int fd = 1;//open(archivo.txt, O_WRONLY, O_CREAT, O_TRUNC, 0644);
ft_putendl_fd("Hello, World!", fd);
return (0);
}