Skip to content

H-kaddour/get_next_line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Get_next_line

image

👋Hey y'all this project it's all about how to read lines in a fd. The fuction that we allow to use is read malloc free, now if we use read it gonna read the whole file content but we want to read line by line so we have to make three fuctions one for reading the fd the second one counts the first line and allocate it and return it and the rest we allocate it in the third function, don't forget we use BUFFER_SIZE to specifie how much read function gonna read.

The project PDF:

https://cdn.intra.42.fr/pdf/pdf/37926/en.subject.pdf

Tester:

https://github.com/Tripouille/gnlTester.git

Prototype:

char	*get_next_line(int fd);

How to compile:

gcc -W -W -W -D BUFFER_SIZE=n files

This are some articles to study the behaviors of get_next_line and static char:

  1. Medium: Check it out.
  2. Static char Check it out.

My final point:

I done the mandatory part and the bonus part, the bonus it's about reading content in every opened fd btw The max opened fd in a pc is 1024 and take a look in *str[fd] array of a pointer.

image

That's all thank u for reading, have a good one 🚀

Releases

No releases published

Packages

No packages published

Languages