-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
31 lines (28 loc) · 1.14 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ehafidi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/19 16:21:36 by ehafidi #+# #+# */
/* Updated: 2019/11/25 17:50:24 by ehafidi ### ########.fr */
/* */
/* ************************************************************************** */
# include "get_next_line.h"
int main()
{
char *line;
int fd;
int ret;
line = NULL;
fd = open("lorem", O_RDONLY);
while ((ret = get_next_line(fd, &line)))
{
printf("%d|%s\n", ret, line);
free(line);
}
printf("%d|%s\n", ret, line);
free(line);
return (0);
}