-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
37 lines (34 loc) · 1.18 KB
/
main.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hk <hk@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/04 02:52:14 by xjose #+# #+# */
/* Updated: 2024/07/25 12:47:27 by hk ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
#include <fcntl.h>
#include <stdio.h>
int main(void)
{
int fd;
int fd2;
char *tmp;
size_t i;
i = 0;
fd = open("./text", 0);
//fd2 = open("./text2", 0);
while (1)
{
tmp = get_next_line(fd);
if (tmp == NULL)
break;
printf("%s", tmp);
free(tmp);
i++;
}
return (0);
}