Mini projet en C de première année Epitech.
Le GetNextLine (GNL) permet de récupérer ligne par ligne un file descriptor à la façon de GetLine.
Ce repo peut vous servir d'exemple, il passe 100% des tests. Attention au -42 !
Epitech Project GetNextLine (GNL)
License: GNU General Public License v2.0
The program should free every memory it allocates except the one used to return a pointer to the string.
The actual method is leaking about 60% of total memory.
Use the current version (COMMIT 6eb8c36) and a simple main function that iterates over a file's content and displays (then frees) each string returned by the GNL.
int main(int ac, char **av)
{
char *s;
int fd;
if (ac < 2)
return (1);
fd = open(av[1], O_RDONLY);
if (fd == -1)
return (1);
while ((s = get_next_line(fd)) != NULL)
{
puts(s);
free(s);
}
close(fd);
return (0);
}
Using the previous main with 'get_next_line.h' as an argument and valgrind to reveal memory leaks outputs the following:
total heap usage: 118 allocs, 21 frees, 3,415 bytes allocated.
BON EN VRAI BALLEC GG 100% M9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.