-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_bonus.c
43 lines (40 loc) · 1.47 KB
/
main_bonus.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
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dalves-p <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/06/13 20:54:29 by dalves-p #+# #+# */
/* Updated: 2021/06/22 21:39:02 by dalves-p ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include "get_next_line.h"
int main(void)
{
int fd;
int fd2;
char *line;
fd = open("song.txt", O_RDONLY);
get_next_line(fd, &line);
printf("%s\n", line);
fd2 = open("song2.txt", O_RDONLY);
get_next_line(fd2, &line);
printf("%s\n", line);
get_next_line(fd, &line);
printf("%s\n", line);
get_next_line(fd2, &line);
printf("%s\n", line);
get_next_line(fd, &line);
printf("%s\n", line);
get_next_line(fd2, &line);
printf("%s\n", line);
get_next_line(fd, &line);
printf("%s\n", line);
return (0);
}