Fichier PDF

Partagez, hébergez et archivez facilement vos documents au format PDF

Partager un fichier Mes fichiers Boite à outils PDF Recherche Aide Contact



gnl en .pdf



Nom original: gnl-en.pdf

Ce document au format PDF 1.5 a été généré par LaTeX with hyperref package / pdfTeX-1.40.16, et a été envoyé sur fichier-pdf.fr le 15/01/2016 à 23:17, depuis l'adresse IP 82.120.x.x. La présente page de téléchargement du fichier a été vue 458 fois.
Taille du document: 251 Ko (6 pages).
Confidentialité: fichier public




Télécharger le fichier (PDF)









Aperçu du document


Elementary Programming
get_next_line

Teacher in charge
younes2.serraj@epitech.eu
Last update
26/11/2015_18h13

Contents
Administrative details

2

Subject

3

Authorized functions

5

1

Elementary Programming

get_next_line

Administrative details
• Name of the turn-in repository: CPE_year_getnextline
Example for the school year 2015-2016 : CPE_2015_getnextline

Be careful:
you turn in

the norm will be checked for every single file

2

Elementary Programming

get_next_line

Subject
• The goal of this project is to write a function that returns a line read from a file
descriptor.
• You must define a macro called READ_SIZE in your get_next_line.h file as it is
defined below (including the #ifndef protection).
◦ This macro indicates the number of characters to read at each call of read().
◦ The value 14 used below is given here just as an example. You can use the
value you want as long as it’s a strictly positive number.
◦ The value of this macro will be changed (by another strictly positive value)
during the evaluation to make sure that you are using it correctly.
1
2
3
4

# ifndef READ_SIZE
# define READ_SIZE (14)
# endif /* !READ_SIZE */

• You must use one (or several) static variable(s) to save the characters that were
read but not sent back to the calling function.
• You shall turn in two files get_next_line.c and get_next_line.h that must be
located at the root of your repository.
• Your repository shall not contain any Makefile nor main function.
• The macro READ_SIZE, as well as the get_next_line function prototype, must be
located in a file named get_next_line.h
• get_next_line shall return its result without the \n. If there is nothing more to
read on the file descriptor, or if an error occured while reading, the function returns
NULL.
• The function shall be prototyped as follows:
1
2

char

*get_next_line(const int fd);

• Turn in:
get_next_line.h and get_next_line.c
• Example of how to use the get_next_line function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14

/*
**
**
**
**
**
**
**
*/

main.c for get_next_line_main_test in
Made by tek assistant
Login
<astek@epitech.net>
Started on Mon Nov 5 14:59:09 2001 tek assistant
Last update Mon Nov 5 14:59:09 2001 tek assistant

#include "my.h"
#include "get_next_line.h"
int

main()

3

Elementary Programming

15
16
17
18
19
20
21
22
23
24
25
26

get_next_line

{
char

*s;

while ((s = get_next_line(0)))
{
my_putstr(s);
my_putchar(’\n’);
free(s);
}
return (0);
}

4

Elementary Programming

get_next_line

Authorized functions
• read
• malloc
• free

5


Documents similaires


Fichier PDF gnl en
Fichier PDF amc170 series gprs modem at command set 71c
Fichier PDF plan your journey info fly
Fichier PDF b cpe 042 day03 2
Fichier PDF finkel10
Fichier PDF serie formulaireconsutantinformations corrige


Sur le même sujet..