aboutsummaryrefslogtreecommitdiff
path: root/exam01/subjects/4-1-ft_range
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-16 12:58:13 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-16 12:58:13 +0200
commit14914f50c3de6c5444e13cf67db064b03c1c90ef (patch)
tree3ecf5a41b4541980ba0287a431681cd5ae25ad84 /exam01/subjects/4-1-ft_range
parent217bcb0d4e3ba60604921cb40d5a11a64f93cfc7 (diff)
downloadpiscine-14914f50c3de6c5444e13cf67db064b03c1c90ef.tar.gz
piscine-14914f50c3de6c5444e13cf67db064b03c1c90ef.tar.bz2
piscine-14914f50c3de6c5444e13cf67db064b03c1c90ef.zip
c09 passed, c10 start, exam00 and exam01
Diffstat (limited to 'exam01/subjects/4-1-ft_range')
-rw-r--r--exam01/subjects/4-1-ft_range/subject.en.txt19
-rw-r--r--exam01/subjects/4-1-ft_range/subject.fr.txt19
2 files changed, 38 insertions, 0 deletions
diff --git a/exam01/subjects/4-1-ft_range/subject.en.txt b/exam01/subjects/4-1-ft_range/subject.en.txt
new file mode 100644
index 0000000..66a77a2
--- /dev/null
+++ b/exam01/subjects/4-1-ft_range/subject.en.txt
@@ -0,0 +1,19 @@
+Assignment name : ft_range
+Expected files : ft_range.c
+Allowed functions: malloc
+--------------------------------------------------------------------------------
+
+Write the following function:
+
+int *ft_range(int start, int end);
+
+It must allocate (with malloc()) an array of integers, fill it with consecutive
+values that begin at start and end at end (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 1, 2 and 3.
+- With (-1, 2) you will return an array containing -1, 0, 1 and 2.
+- With (0, 0) you will return an array containing 0.
+- With (0, -3) you will return an array containing 0, -1, -2 and -3.
diff --git a/exam01/subjects/4-1-ft_range/subject.fr.txt b/exam01/subjects/4-1-ft_range/subject.fr.txt
new file mode 100644
index 0000000..9e848b3
--- /dev/null
+++ b/exam01/subjects/4-1-ft_range/subject.fr.txt
@@ -0,0 +1,19 @@
+Assignment name : ft_range
+Expected files : ft_range.c
+Allowed functions: malloc
+--------------------------------------------------------------------------------
+
+Écrire la fonction suivante :
+
+int *ft_range(int start, int end);
+
+Cette fonction doit allouer avec malloc() un tableau d'ints, le remplir avec
+les valeurs (consécutives) démarrant à start et finissant à end (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 1, 2 et 3.
+- Avec (-1, 2) vous devrez renvoyer un tableau contenant -1, 0, 1 et 2.
+- Avec (0, 0) vous devrez renvoyer un tableau contenant 0.
+- Avec (0, -3) vous devrez renvoyer un tableau contenant 0, -1, -2 et -3.