Skip to content

breakstate/42_get_next_line

Repository files navigation

42_get_next_line

Parent school: Ecole 42

School: WeThinkCode_ Johannesburg

Year: 1

Semester: 1

Branch: Algorithms

Summary:

The aim of this project is to create a function that returns a line ending with a newline, read from a file descriptor.

Learning opportunities:

  • Static variables
  • Memory allocation
  • Buffers

Instructions

  • Submit .c and .h

  • Use of libft project allowed and encouraged

  • Do not submit a main

  • Project must be Norminette compliant (42 C programming standard)

  • Handle errors - project must not quit in an unexpected manner (Seg fault, bus error, double free, etc)

  • No memory leaks

  • Include author file

  • Allowed functions: read, malloc and free

Usage:

Parameters:

Call function from program, providing a valid file descriptor and the address of a char pointer.

Return values:

Returns 1 when a line is read successfully, 0 when reached end of file and -1 in the case of a read error.

About

Algo - a function that returns a line read from a file descriptor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages