aboutsummaryrefslogtreecommitdiff
path: root/1-0-ft_printf
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-02-14 19:21:32 +0100
committerCharles <sircharlesaze@gmail.com>2020-02-14 19:21:32 +0100
commitb9a3fe5af32ebe91c2cc0346ec74844a06b2697f (patch)
tree24806cc7065e86ae7525b11e3727dfc98cf396c7 /1-0-ft_printf
parent724b3b6a1620078a003a0507554886d7cdb27bde (diff)
downloadexam_rank_02-b9a3fe5af32ebe91c2cc0346ec74844a06b2697f.tar.gz
exam_rank_02-b9a3fe5af32ebe91c2cc0346ec74844a06b2697f.tar.bz2
exam_rank_02-b9a3fe5af32ebe91c2cc0346ec74844a06b2697f.zip
1st try
Diffstat (limited to '1-0-ft_printf')
-rw-r--r--1-0-ft_printf/subject.en.txt33
-rw-r--r--1-0-ft_printf/subject.es.txt29
-rw-r--r--1-0-ft_printf/subject.fr.txt32
3 files changed, 94 insertions, 0 deletions
diff --git a/1-0-ft_printf/subject.en.txt b/1-0-ft_printf/subject.en.txt
new file mode 100644
index 0000000..f4a7861
--- /dev/null
+++ b/1-0-ft_printf/subject.en.txt
@@ -0,0 +1,33 @@
+Assignment name : ft_printf
+Expected files : ft_printf.c
+Allowed functions: malloc, free, write, va_start, va_arg, va_copy, va_end
+--------------------------------------------------------------------------------
+
+Write a function named `ft_printf` that will mimic the real printf with the following constraints:
+
+- It will manage only the following conversions: s,d and x
+- It will manage the minimum field width. (we will never test with a field with of 0)
+- It will manage only the precison flag `.`.
+
+Your function must be declared as follows:
+
+int ft_printf(const char *, ... );
+
+Before you start we advise you to read the `man 3 printf` and the `man va_arg`.
+To test your program compare your results with the true printf.
+
+Your function must not leak.
+
+
+Exemples of the function output:
+
+call: ft_printf("%10.2s\n", "toto");
+out: to$
+
+call: ft_printf("Magic %s is %5d", "number", 42);
+out:Magic number is 42%
+
+call: ft_printf("Hexadecimal for %d is %x\n", 42, 42);
+out:Hexadecimal for 42 is 2a$
+
+Warning: Your function must not have any leaks, this will be checked during moulinette \ No newline at end of file
diff --git a/1-0-ft_printf/subject.es.txt b/1-0-ft_printf/subject.es.txt
new file mode 100644
index 0000000..f1ee40d
--- /dev/null
+++ b/1-0-ft_printf/subject.es.txt
@@ -0,0 +1,29 @@
+Assignment name : ft_printf
+Expected files : ft_printf.c
+Allowed functions: malloc, free, write, va_start, va_arg, va_copy, va_end
+--------------------------------------------------------------------------------
+
+Escriba una función que se llame `ft_printf`, que reproducirá una pequeña parte del comportamiento del verdadero printf, con las siguientes limitaciones:
+
+
+- Sólo gestionará las conversiones : s,d y x
+- Debe gestionar el tamaño mínimo de campo. (Nunca probaremos su programa con un tamaño de campo igual a 0)
+- Sólo gestionará el flag de precisión `.`.
+
+La función deberá seguir el siguiente prototipo:
+
+int ft_printf(const char *, ... );
+
+Antes de empezar, le aconsejamos que lea `man 3 printf` y `man va_arg`.
+Le aconsejamos que para probar su programa lo compare con el verdadero printf.
+
+Ejemplos de salida de la función:
+
+call: ft_printf("%10.2s\n", "toto");
+out: to$
+
+call: ft_printf("Magic %s is %5d", "number", 42);
+out:Magic number is 42%
+
+call: ft_printf("Hexadecimal for %d is %x\n", 42, 42);
+out:Hexadecimal for 42 is 2a$
diff --git a/1-0-ft_printf/subject.fr.txt b/1-0-ft_printf/subject.fr.txt
new file mode 100644
index 0000000..852cd56
--- /dev/null
+++ b/1-0-ft_printf/subject.fr.txt
@@ -0,0 +1,32 @@
+Assignment name : ft_printf
+Expected files : ft_printf.c
+Allowed functions: malloc, free, write, va_start, va_arg, va_copy, va_end
+--------------------------------------------------------------------------------
+
+Vous devez rendre une fonction nommée `ft_printf` qui reproduira une petite partie du comportement du vrai printf avec les contraintes suivantes :
+
+- Vous devez gérer uniquement les conversions suivantes : s,d et x
+- Vous devez gérer la taille de champ minimal. (Nous ne testerons jamais votre programme avec une taille de champ minimal de 0)
+- Vous devez gérer uniquement le flag de précision `.`.
+
+Votre fonction devra être prototypée de la façon suivante :
+
+int ft_printf(const char *, ... );
+
+Avant de commencer nous vous conseillons la lecture du `man 3 printf` et du `man va_arg`.
+Nous vous recommandons de tester votre programme en le comparant avec le vrai printf.
+
+Votre fonction ne doit pas avoir de fuites mémoires.
+
+Exemples de sortie de la fonction:
+
+call: ft_printf("%10.2s\n", "toto");
+out: to$
+
+call: ft_printf("Magic %s is %5d", "number", 42);
+out:Magic number is 42%
+
+call: ft_printf("Hexadecimal for %d is %x\n", 42, 42);
+out:Hexadecimal for 42 is 2a$
+
+Rappel: Votre fonction ne doit pas avoir de fuites mémoire. Cela sera vérifié par la moulinette. \ No newline at end of file