Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 609 Bytes

README.md

File metadata and controls

30 lines (19 loc) · 609 Bytes

get_next_line

why just don't use pathlib smh

The aim of this project is to make you code a function that returns a line, read from a file descriptor.

from pathlib import Path
for line in Path('README.md').open():
    print(line)

diffences to newer subject

old (this)

int get_next_line(int fd, char **line)

  • reference to char *line is passed to store lines read
  • returns lengths read, -1 if error

new

char *get_next_line(int fd)

  • returns read line
  • returns NULL if error