aboutsummaryrefslogtreecommitdiff
path: root/c09/ex00
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-15 08:15:37 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-15 08:15:37 +0200
commit3b9a1d7dcc5683b962f2bf24795e80e1c449cd1f (patch)
tree25b02c02f5140dbefbabd7720f292d8be3d5cc51 /c09/ex00
parentc2bf9fcefbb4453cee271ccd1af9674ad2f3a181 (diff)
downloadpiscine-3b9a1d7dcc5683b962f2bf24795e80e1c449cd1f.tar.gz
piscine-3b9a1d7dcc5683b962f2bf24795e80e1c449cd1f.tar.bz2
piscine-3b9a1d7dcc5683b962f2bf24795e80e1c449cd1f.zip
c07 passed, c08 in progress, rush01(+ 6x6 try)
Diffstat (limited to 'c09/ex00')
-rw-r--r--c09/ex00/ft_putchar.c18
-rw-r--r--c09/ex00/ft_putstr.c19
-rw-r--r--c09/ex00/ft_strcmp.c21
-rw-r--r--c09/ex00/ft_strlen.c22
-rw-r--r--c09/ex00/ft_swap.c20
-rw-r--r--c09/ex00/libft_creator.sh3
6 files changed, 103 insertions, 0 deletions
diff --git a/c09/ex00/ft_putchar.c b/c09/ex00/ft_putchar.c
new file mode 100644
index 0000000..8a53dc8
--- /dev/null
+++ b/c09/ex00/ft_putchar.c
@@ -0,0 +1,18 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_putchar.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/02 22:03:32 by cacharle #+# #+# */
+/* Updated: 2019/07/03 14:21:40 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include <unistd.h>
+
+void ft_putchar(char c)
+{
+ write(1, &c, 1);
+}
diff --git a/c09/ex00/ft_putstr.c b/c09/ex00/ft_putstr.c
new file mode 100644
index 0000000..c4f4564
--- /dev/null
+++ b/c09/ex00/ft_putstr.c
@@ -0,0 +1,19 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_putstr.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/11 16:17:16 by cacharle #+# #+# */
+/* Updated: 2019/07/11 16:18:11 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include <unistd.h>
+
+void ft_putstr(char *str)
+{
+ while (*str)
+ write(1, str++, 1);
+}
diff --git a/c09/ex00/ft_strcmp.c b/c09/ex00/ft_strcmp.c
new file mode 100644
index 0000000..8870811
--- /dev/null
+++ b/c09/ex00/ft_strcmp.c
@@ -0,0 +1,21 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strcmp.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/11 16:20:33 by cacharle #+# #+# */
+/* Updated: 2019/07/11 16:21:55 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+int ft_strcmp(char *s1, char *s2)
+{
+ while (*s1 == *s2 && *s1 && *s2)
+ {
+ s1++;
+ s2++;
+ }
+ return (*s1 - *s2);
+}
diff --git a/c09/ex00/ft_strlen.c b/c09/ex00/ft_strlen.c
new file mode 100644
index 0000000..91e6948
--- /dev/null
+++ b/c09/ex00/ft_strlen.c
@@ -0,0 +1,22 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strlen.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/11 16:19:43 by cacharle #+# #+# */
+/* Updated: 2019/07/11 16:20:18 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+int ft_strlen(char *str)
+{
+ int i;
+
+ i = 0;
+ while (str[i])
+ i++;
+ return (i);
+}
+
diff --git a/c09/ex00/ft_swap.c b/c09/ex00/ft_swap.c
new file mode 100644
index 0000000..989b2c2
--- /dev/null
+++ b/c09/ex00/ft_swap.c
@@ -0,0 +1,20 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_swap.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/11 16:18:42 by cacharle #+# #+# */
+/* Updated: 2019/07/11 16:19:31 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+void ft_swap(int *a, int *b)
+{
+ int tmp;
+
+ tmp = *a;
+ *a = *b;
+ *b = tmp;
+}
diff --git a/c09/ex00/libft_creator.sh b/c09/ex00/libft_creator.sh
new file mode 100644
index 0000000..f799ee2
--- /dev/null
+++ b/c09/ex00/libft_creator.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+gcc -c *.c
+ar -rcs libft.a *.o