-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putchar_fd.c
27 lines (25 loc) · 1.12 KB
/
ft_putchar_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putchar_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akdemir <akdemir@student.42istanbul.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/09 20:42:03 by akdemir #+# #+# */
/* Updated: 2023/07/20 15:04:52 by akdemir ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putchar_fd(char c, int fd)
{
write(1, &c, 1);
}
int main()
{
int fd;
fd=open("a.txt",O_CREAT | O_RDWR, 0777);
ft_putchar_fd('a',fd);
ft_putchar_fd('ab',fd);
fd=open("ab.txt",O_CREAT | O_RDWR, 0777);
ft_putchar_fd('b',fd);
}