From de6099c26ddd7a95fe2e0eaa7e6dad13d9526b32 Mon Sep 17 00:00:00 2001 From: Aleksei Chubukov Date: Wed, 22 Nov 2023 19:59:54 +0400 Subject: [PATCH] add c01/ex0{1,2} --- Makefile | 2 +- c01/ex01.c | 20 ++++++++++++++++++++ c01/ex02.c | 11 +++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 c01/ex01.c create mode 100644 c01/ex02.c diff --git a/Makefile b/Makefile index 1b25575..cf9e408 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ clean: build/c%: $(OFFSHORE_PROJECTS)/c$$(subst _,+,$$*)/*.c $$(OFFSHORE_MAINS)/c$$*.c mkdir -p $(@D) $(CC) -o $@ $(CFLAGS_MANDATORY) $(CFLAGS) $^ -norme: $$(foreach c, 00 01, $(OFFSHORE_PROJECTS)/c$$c) +norme: $$(wildcard $(OFFSHORE_PROJECTS)/c*) norminette -R CheckForbiddenSourceHeader $^ .PHONY: all norme clean diff --git a/c01/ex01.c b/c01/ex01.c new file mode 100644 index 0000000..325c667 --- /dev/null +++ b/c01/ex01.c @@ -0,0 +1,20 @@ +#include +void ft_ultimate_ft(int *********nbr); +int main(void) +{ + int n = -666; + int *j1 = &n; + int **j2 = &j1; + int ***j3 = &j2; + int ****j4 = &j3; + int *****j5 = &j4; + int ******j6 = &j5; + int *******j7 = &j6; + int ********j8 = &j7; + int *********johnny = &j8; + + printf("was %d\n", n); + ft_ultimate_ft(johnny); + printf("now %d\n", n); + +} diff --git a/c01/ex02.c b/c01/ex02.c new file mode 100644 index 0000000..6eac6fd --- /dev/null +++ b/c01/ex02.c @@ -0,0 +1,11 @@ +#include +void ft_swap(int *a, int *b); + +int main(void) +{ + int one = 1; + int two = 2; + printf("was %d %d\n", one, two); + ft_swap(&one, &two); + printf("now %d %d\n", one, two); +}