-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putstr_fd.c
38 lines (33 loc) · 1.15 KB
/
ft_putstr_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
36
37
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: youel-id <youel-id@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/16 00:20:48 by youel-id #+# #+# */
/* Updated: 2022/10/28 17:21:33 by youel-id ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putstr_fd(char *s, int fd)
{
int i;
i = 0;
if (s)
{
while (s[i])
{
write(fd, &s[i], 1);
i++;
}
}
}
/*int main()
{
int fd;
fd = open("test12.txt", O_CREAT | O_RDWR);
char str[] = "charafchdidjesus";
ft_putstr_fd(str,fd);
return 0;
}*/