-
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: nperez-d <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/02 16:01:29 by nperez-d #+# #+# */
/* Updated: 2024/04/26 14:24:06 by nperez-d ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
#include <fcntl.h>
#include <stdio.h>
int main(void)
{
int fd;
char *line;
int i;
int j;
i = 0;
j = 1;
fd = open("test.txt", O_RDONLY);
while (i < 10)
{
line = get_next_line(fd);
printf("Linea [%d]:\n%s\n", j, line);
free(line);
i++;
j++;
}
close(fd);
return (0);
}