aboutsummaryrefslogtreecommitdiff
path: root/exam02/subjects/6-0-ft_list_remove_if
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-24 18:57:19 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-24 18:57:19 +0200
commit475449dd4b1f3308bac6f72c34d87812216a0738 (patch)
tree319a76f0e87b041818156f2d1dfbbc6a7dfacf06 /exam02/subjects/6-0-ft_list_remove_if
parent83edb77d74bb339f3e1324a51039c78ac503db90 (diff)
downloadpiscine-475449dd4b1f3308bac6f72c34d87812216a0738.tar.gz
piscine-475449dd4b1f3308bac6f72c34d87812216a0738.tar.bz2
piscine-475449dd4b1f3308bac6f72c34d87812216a0738.zip
exam02
Diffstat (limited to 'exam02/subjects/6-0-ft_list_remove_if')
-rw-r--r--exam02/subjects/6-0-ft_list_remove_if/subject.en.txt23
-rw-r--r--exam02/subjects/6-0-ft_list_remove_if/subject.fr.txt23
2 files changed, 46 insertions, 0 deletions
diff --git a/exam02/subjects/6-0-ft_list_remove_if/subject.en.txt b/exam02/subjects/6-0-ft_list_remove_if/subject.en.txt
new file mode 100644
index 0000000..f9b9783
--- /dev/null
+++ b/exam02/subjects/6-0-ft_list_remove_if/subject.en.txt
@@ -0,0 +1,23 @@
+Assignment name : ft_list_remove_if
+Expected files : ft_list_remove_if.c
+Allowed functions: free
+--------------------------------------------------------------------------------
+
+Write a function called ft_list_remove_if that removes from the
+passed list any element the data of which is "equal" to the reference data.
+
+It will be declared as follows :
+
+void ft_list_remove_if(t_list **begin_list, void *data_ref, int (*cmp)());
+
+cmp takes two void* and returns 0 when both parameters are equal.
+
+You have to use the ft_list.h file, which will contain:
+
+$>cat ft_list.h
+typedef struct s_list
+{
+ struct s_list *next;
+ void *data;
+} t_list;
+$>
diff --git a/exam02/subjects/6-0-ft_list_remove_if/subject.fr.txt b/exam02/subjects/6-0-ft_list_remove_if/subject.fr.txt
new file mode 100644
index 0000000..cba53ae
--- /dev/null
+++ b/exam02/subjects/6-0-ft_list_remove_if/subject.fr.txt
@@ -0,0 +1,23 @@
+Assignment name : ft_list_remove_if
+Expected files : ft_list_remove_if.c
+Allowed functions: free
+--------------------------------------------------------------------------------
+
+Écrire une fonction ft_list_remove_if qui efface de la liste tous les élements
+dont la donnée est "égale" à la donnée de référence.
+
+Elle devra être prototypée de la façon suivante :
+
+void ft_list_remove_if(t_list **begin_list, void *data_ref, int (*cmp)());
+
+cmp prends deux void* et renvoie 0 lorsque les 2 paramètres sont égaux.
+
+À la correction, vous disposez du fichier ft_list.h tel que :
+
+$>cat ft_list.h
+typedef struct s_list
+{
+ struct s_list *next;
+ void *data;
+} t_list;
+$>