From c665b6c546ce25a41eec4eccc9f9332e4504cffb Mon Sep 17 00:00:00 2001 From: Guy Baconniere Date: Mon, 16 Aug 2021 09:00:55 +0200 Subject: [PATCH] sync --- C_Piscine_C_04/git/ex00/main.c | 32 ++++++++++++++++++++++++++++++++ C_Piscine_C_04/git/ex00/main.sh | 8 ++++++++ C_Piscine_C_04/git/ex01/main.c | 30 ++++++++++++++++++++++++++++++ C_Piscine_C_04/git/ex01/main.sh | 8 ++++++++ C_Piscine_C_04/git/ex02/main.c | 30 ++++++++++++++++++++++++++++++ C_Piscine_C_04/git/ex02/main.sh | 8 ++++++++ C_Piscine_C_04/git/ex03/main.c | 30 ++++++++++++++++++++++++++++++ C_Piscine_C_04/git/ex03/main.sh | 8 ++++++++ Makefile | 10 ++++++++++ 9 files changed, 164 insertions(+) create mode 100644 C_Piscine_C_04/git/ex00/main.c create mode 100755 C_Piscine_C_04/git/ex00/main.sh create mode 100644 C_Piscine_C_04/git/ex01/main.c create mode 100755 C_Piscine_C_04/git/ex01/main.sh create mode 100644 C_Piscine_C_04/git/ex02/main.c create mode 100755 C_Piscine_C_04/git/ex02/main.sh create mode 100644 C_Piscine_C_04/git/ex03/main.c create mode 100755 C_Piscine_C_04/git/ex03/main.sh create mode 100644 Makefile diff --git a/C_Piscine_C_04/git/ex00/main.c b/C_Piscine_C_04/git/ex00/main.c new file mode 100644 index 0000000..42b0d1f --- /dev/null +++ b/C_Piscine_C_04/git/ex00/main.c @@ -0,0 +1,32 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: gbaconni +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2021/08/13 09:02:59 by gbaconni #+# #+# */ +/* Updated: 2021/08/13 09:03:17 by gbaconni ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include + +int ft_strlen(char *str); + +int main(void) +{ + char str[32]; + int result; + + printf("Input String [max 31]: "); + scanf("%s", str); + result = ft_strlen(str); + printf("str=%s result=%d (ft_strlen)\n", str, result); + result = strlen(str); + printf("str=%s result=%d (strlen)\n", str, result); + return (0); +} diff --git a/C_Piscine_C_04/git/ex00/main.sh b/C_Piscine_C_04/git/ex00/main.sh new file mode 100755 index 0000000..292faee --- /dev/null +++ b/C_Piscine_C_04/git/ex00/main.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +#norminette -R CheckForbiddenSourceHeader ft_*.c +norminette -R CheckForbiddenSourceHeader +gcc -Wall -Wextra -Werror -o a.out *.c +echo $(basename $PWD): +./a.out +rm -f a.out diff --git a/C_Piscine_C_04/git/ex01/main.c b/C_Piscine_C_04/git/ex01/main.c new file mode 100644 index 0000000..a4ad833 --- /dev/null +++ b/C_Piscine_C_04/git/ex01/main.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: gbaconni +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2021/08/13 09:13:32 by gbaconni #+# #+# */ +/* Updated: 2021/08/13 09:20:53 by gbaconni ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include + +void ft_putstr(char *str); + +int main(void) +{ + char str[32]; + + printf("Input String [max 31]: "); + scanf("%s", str); + ft_putstr(str); + write(1, "\n", 1); + printf("str=%s (ft_putstr)\n", str); + return (0); +} diff --git a/C_Piscine_C_04/git/ex01/main.sh b/C_Piscine_C_04/git/ex01/main.sh new file mode 100755 index 0000000..292faee --- /dev/null +++ b/C_Piscine_C_04/git/ex01/main.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +#norminette -R CheckForbiddenSourceHeader ft_*.c +norminette -R CheckForbiddenSourceHeader +gcc -Wall -Wextra -Werror -o a.out *.c +echo $(basename $PWD): +./a.out +rm -f a.out diff --git a/C_Piscine_C_04/git/ex02/main.c b/C_Piscine_C_04/git/ex02/main.c new file mode 100644 index 0000000..7827ee1 --- /dev/null +++ b/C_Piscine_C_04/git/ex02/main.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: gbaconni +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2021/08/13 09:22:26 by gbaconni #+# #+# */ +/* Updated: 2021/08/13 11:18:57 by gbaconni ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include + +void ft_putnbr(int nb); + +int main(void) +{ + int nb; + + printf("Input Number: "); + scanf("%d", &nb); + ft_putnbr(nb); + write(1, "\n", 1); + printf("nb=%d (ft_putnbr)\n", nb); + return (0); +} diff --git a/C_Piscine_C_04/git/ex02/main.sh b/C_Piscine_C_04/git/ex02/main.sh new file mode 100755 index 0000000..292faee --- /dev/null +++ b/C_Piscine_C_04/git/ex02/main.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +#norminette -R CheckForbiddenSourceHeader ft_*.c +norminette -R CheckForbiddenSourceHeader +gcc -Wall -Wextra -Werror -o a.out *.c +echo $(basename $PWD): +./a.out +rm -f a.out diff --git a/C_Piscine_C_04/git/ex03/main.c b/C_Piscine_C_04/git/ex03/main.c new file mode 100644 index 0000000..7fc3eb3 --- /dev/null +++ b/C_Piscine_C_04/git/ex03/main.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: gbaconni +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2021/08/13 12:46:41 by gbaconni #+# #+# */ +/* Updated: 2021/08/13 13:58:09 by gbaconni ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include + +int ft_atoi(char *str); + +int main(void) +{ + char str[32]; + int result; + + printf("Input String [31]: "); + scanf("%s", str); + result = ft_atoi(str); + printf("str=%s result=%d (ft_atoi)\n", str, result); + return (0); +} diff --git a/C_Piscine_C_04/git/ex03/main.sh b/C_Piscine_C_04/git/ex03/main.sh new file mode 100755 index 0000000..292faee --- /dev/null +++ b/C_Piscine_C_04/git/ex03/main.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +#norminette -R CheckForbiddenSourceHeader ft_*.c +norminette -R CheckForbiddenSourceHeader +gcc -Wall -Wextra -Werror -o a.out *.c +echo $(basename $PWD): +./a.out +rm -f a.out diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4421890 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ + +sync: + @rsync --exclude .git --exclude .gitignore --exclude .DS_Store -av ~/Piscine/ . + @git add -A + @git status + @git commit -m 'sync' + @git push + +all: sync +