Get_next_line

Get Next Line

The goal of this project is to learn about static variables and improving your memory management skills (allocating and freeing).

Objectives

char	*get_next_line(int fd);

Requirements

Algorithm

  • get a line

    • start with the content of the previous read data
    • read until new line or EOF
  • make the content after new line in the static variable
  • return the content from the start until new line

Tips

  • be careful when using ft_substr and ft_strjoin (memory leaks).
  • you can implement the bonus first and copy it to the mandatory part.
  • the static variable declaration :
static char		*backup[OPEN_MAX];