Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fcntl.h>
- #include <stdio.h>
- #include "get_next_line.h"
- int main(int argc, char **argv)
- {
- char *line;
- int fd;
- int rd;
- line = "hello";
- if (argc < 2)
- return (-1);
- fd = open(argv[1], O_RDONLY);
- while ((rd = get_next_line(42 , &line)) > 0)
- {
- printf("%s\n", line);
- free(line);
- }
- get_next_line(42, &line);
- printf("%s", line);
- get_next_line(42, &line);
- printf("%s", line);
- get_next_line(42, &line);
- printf("%s", line);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement