-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
30 lines (28 loc) · 1.16 KB
/
main.c
File metadata and controls
30 lines (28 loc) · 1.16 KB
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
/* ************************************************************************** */
/* */
/* :::::::: */
/* main.c :+: :+: */
/* +:+ */
/* By: mde-cloe <mde-cloe@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2022/07/19 19:19:18 by mde-cloe #+# #+# */
/* Updated: 2022/07/26 18:02:57 by mde-cloe ######## odam.nl */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
#include <fcntl.h>
#include <stdio.h>
int main(void)
{
int fd = open("text.txt", O_RDONLY);
char *line = get_next_line(fd);
for (int i = 0; i < 20; i++)
{
printf("%s", line);
free(line);
line = get_next_line(fd);
}
close(fd);
system("leaks a.out");
return 0;
}