diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-07-24 18:57:19 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-07-24 18:57:19 +0200 |
| commit | 475449dd4b1f3308bac6f72c34d87812216a0738 (patch) | |
| tree | 319a76f0e87b041818156f2d1dfbbc6a7dfacf06 /exam02/subjects/5-0-ft_rrange | |
| parent | 83edb77d74bb339f3e1324a51039c78ac503db90 (diff) | |
| download | piscine-475449dd4b1f3308bac6f72c34d87812216a0738.tar.gz piscine-475449dd4b1f3308bac6f72c34d87812216a0738.tar.bz2 piscine-475449dd4b1f3308bac6f72c34d87812216a0738.zip | |
exam02
Diffstat (limited to 'exam02/subjects/5-0-ft_rrange')
| -rw-r--r-- | exam02/subjects/5-0-ft_rrange/subject.en.txt | 19 | ||||
| -rw-r--r-- | exam02/subjects/5-0-ft_rrange/subject.fr.txt | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/exam02/subjects/5-0-ft_rrange/subject.en.txt b/exam02/subjects/5-0-ft_rrange/subject.en.txt new file mode 100644 index 0000000..f9129bc --- /dev/null +++ b/exam02/subjects/5-0-ft_rrange/subject.en.txt @@ -0,0 +1,19 @@ +Assignment name : ft_rrange +Expected files : ft_rrange.c +Allowed functions: malloc +-------------------------------------------------------------------------------- + +Write the following function: + +int *ft_rrange(int start, int end); + +It must allocate (with malloc()) an array of integers, fill it with consecutive +values that begin at end and end at start (Including start and end !), then +return a pointer to the first value of the array. + +Examples: + +- With (1, 3) you will return an array containing 3, 2 and 1 +- With (-1, 2) you will return an array containing 2, 1, 0 and -1. +- With (0, 0) you will return an array containing 0. +- With (0, -3) you will return an array containing -3, -2, -1 and 0. diff --git a/exam02/subjects/5-0-ft_rrange/subject.fr.txt b/exam02/subjects/5-0-ft_rrange/subject.fr.txt new file mode 100644 index 0000000..1a1e44c --- /dev/null +++ b/exam02/subjects/5-0-ft_rrange/subject.fr.txt @@ -0,0 +1,19 @@ +Assignment name : ft_rrange +Expected files : ft_rrange.c +Allowed functions: malloc +-------------------------------------------------------------------------------- + +Écrire la fonction suivante : + +int *ft_rrange(int start, int end); + +Cette fonction doit allouer avec malloc() un tableau d'ints, le remplir avec +les valeurs (consécutives) démarrant à end et finissant à start (start et end +inclus !), et renvoyer un pointeur vers la première valeur du tableau. + +Exemples: + +- Avec (1, 3) vous devrez renvoyer un tableau contenant 3, 2 et 1. +- Avec (-1, 2) vous devrez renvoyer un tableau contenant 2, 1, 0 et -1. +- Avec (0, 0) vous devrez renvoyer un tableau contenant 0. +- Avec (0, -3) vous devrez renvoyer un tableau contenant -3, -2, -1 et 0. |
