0
0

Add main.* and remove .gitignore

This commit is contained in:
2021-08-16 08:26:30 +02:00
parent a808b91a50
commit 44692816d5
85 changed files with 1352 additions and 30 deletions

View File

@@ -1,2 +0,0 @@
**/main.c
**/main.sh

View File

@@ -0,0 +1,19 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 13:12:43 by gbaconni #+# #+# */
/* Updated: 2021/08/05 13:17:47 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
int main(void)
{
void ft_putchar(char c);
ft_putchar('Z');
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,19 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 13:12:05 by gbaconni #+# #+# */
/* Updated: 2021/08/05 13:17:31 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
int main(void)
{
void ft_print_alphabet(void);
ft_print_alphabet();
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,19 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 13:14:21 by gbaconni #+# #+# */
/* Updated: 2021/08/05 13:17:07 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
int main(void)
{
void ft_print_reverse_alphabet(void);
ft_print_reverse_alphabet();
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,19 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 13:15:56 by gbaconni #+# #+# */
/* Updated: 2021/08/05 13:16:46 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
int main(void)
{
void ft_print_numbers(void);
ft_print_numbers();
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,23 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 13:18:40 by gbaconni #+# #+# */
/* Updated: 2021/08/05 13:48:41 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
int main(void)
{
void ft_is_negative(int n);
ft_is_negative(-42);
ft_is_negative(42);
ft_is_negative(0);
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 13:50:48 by gbaconni #+# #+# */
/* Updated: 2021/08/05 14:55:52 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
int main(void)
{
void ft_print_comb(void);
ft_print_comb();
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 17:38:55 by gbaconni #+# #+# */
/* Updated: 2021/08/05 17:39:00 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
int main(void)
{
void ft_print_comb2(void);
ft_print_comb2();
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,28 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 18:07:44 by gbaconni #+# #+# */
/* Updated: 2021/08/06 11:48:27 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
int main(void)
{
void ft_putnbr(int nb);
ft_putnbr(-1);
write(1, "\n", 1);
ft_putnbr(0);
write(1, "\n", 1);
ft_putnbr(42);
write(1, "\n", 1);
ft_putnbr(2147483647);
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/06 09:41:51 by gbaconni #+# #+# */
/* Updated: 2021/08/06 11:32:04 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
int main(void)
{
void ft_print_combn(int n);
ft_print_combn(1);
write(1, "\n", 1);
ft_print_combn(2);
write(1, "\n", 1);
ft_print_combn(3);
write(1, "\n", 1);
ft_print_combn(4);
write(1, "\n", 1);
return (0);
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -1,5 +0,0 @@
**/main.c
**/main.sh
**/a.out
**/a.sh
**/Makefile

View File

@@ -0,0 +1,26 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 09:26:01 by gbaconni #+# #+# */
/* Updated: 2021/08/09 09:26:03 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_ft(int *nbr);
int main(void)
{
int n;
n = 0;
ft_ft(&n);
printf("%d\n", n);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,44 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 10:33:35 by gbaconni #+# #+# */
/* Updated: 2021/08/09 10:33:36 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_ultimate_ft(int *********nbr);
int main(void)
{
int n;
int *ptr1;
int **ptr2;
int ***ptr3;
int ****ptr4;
int *****ptr5;
int ******ptr6;
int *******ptr7;
int ********ptr8;
int *********ptr9;
n = 0;
ptr1 = &n;
ptr2 = &ptr1;
ptr3 = &ptr2;
ptr4 = &ptr3;
ptr5 = &ptr4;
ptr6 = &ptr5;
ptr7 = &ptr6;
ptr8 = &ptr7;
ptr9 = &ptr8;
ft_ultimate_ft(ptr9);
printf("%d\n", n);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader ft_*.c
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 10:45:18 by gbaconni #+# #+# */
/* Updated: 2021/08/09 10:49:16 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_swap(int *a, int *b);
int main(void)
{
int a;
int b;
a = 21;
b = 42;
printf("BEFORE: a=%d b=%d\n", a, b);
ft_swap(&a, &b);
printf("AFTER: a=%d b=%d\n", a, b);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader ft_*.c
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 10:51:11 by gbaconni #+# #+# */
/* Updated: 2021/08/09 10:56:46 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_div_mod(int a, int b, int *div, int *mod);
int main(void)
{
int a;
int b;
int div;
int mod;
a = 43;
b = 21;
div = 0;
mod = 0;
printf("BEFORE: a=%d b=%d div=%d mod=%d\n", a, b, div, mod);
ft_div_mod(a, b, &div, &mod);
printf("AFTER: a=%d b=%d div=%d mod=%d\n", a, b, div, mod);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader ft_*.c
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 11:08:45 by gbaconni #+# #+# */
/* Updated: 2021/08/09 11:08:47 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_ultimate_div_mod(int *a, int *b);
int main(void)
{
int a;
int b;
a = 43;
b = 21;
printf("BEFORE: a=%d b=%d\n", a, b);
ft_ultimate_div_mod(&a, &b);
printf("AFTER: a=%d b=%d\n", a, b);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader ft_*.c
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 11:12:49 by gbaconni #+# #+# */
/* Updated: 2021/08/09 11:19:05 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_putstr(char *str);
int main(void)
{
ft_putstr("42");
write(1, "\n", 1);
ft_putstr("Hello");
write(1, "\n", 1);
ft_putstr("World");
write(1, "\n", 1);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader ft_*.c
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 11:21:01 by gbaconni #+# #+# */
/* Updated: 2021/08/09 11:25:11 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
int ft_strlen(char *str);
int main(void)
{
int size;
size = ft_strlen("42");
printf("size=%d (42)\n", size);
size = ft_strlen("Hello");
printf("size=%d (Hello)\n", size);
size = ft_strlen("World");
printf("size=%d (World)\n", size);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader ft_*.c
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,38 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 13:38:52 by gbaconni #+# #+# */
/* Updated: 2021/08/09 17:02:02 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_rev_int_tab(int *tab, int size);
int main(void)
{
int tab5[5];
int tab2[2];
tab5[0] = 1;
tab5[1] = 2;
tab5[2] = 3;
tab5[3] = 4;
tab5[4] = 5;
tab2[0] = 1;
tab2[1] = 2;
printf("%d,%d,%d,%d,%d\n", tab5[0], tab5[1], tab5[2], tab5[3], tab5[4]);
ft_rev_int_tab(tab5, 5);
printf("%d,%d,%d,%d,%d\n", tab5[0], tab5[1], tab5[2], tab5[3], tab5[4]);
printf("%d,%d\n", tab2[0], tab2[1]);
ft_rev_int_tab(tab2, 2);
printf("%d,%d\n", tab2[0], tab2[1]);
ft_rev_int_tab(tab2, 2);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader ft_*.c
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 14:22:56 by gbaconni #+# #+# */
/* Updated: 2021/08/09 14:42:03 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_sort_int_tab(int *tab, int size);
int main(void)
{
int tab[4];
tab[0] = 31;
tab[1] = 21;
tab[2] = 7;
tab[3] = 12;
printf("%d,%d,%d,%d\n", tab[0], tab[1], tab[2], tab[3]);
ft_sort_int_tab(tab, 4);
printf("%d,%d,%d,%d\n", tab[0], tab[1], tab[2], tab[3]);
return (0);
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
norminette -R CheckForbiddenSourceHeader ft_*.c
gcc -Wall -Wextra -Werror -o a.out *.c
echo $(basename $PWD):
./a.out
rm -f a.out

View File

@@ -1,7 +0,0 @@
**/main.c
**/main.sh
**/a.out
**/a.sh
**/Makefile
**/*.swp
**/*~

View File

@@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 13:15:38 by gbaconni #+# #+# */
/* Updated: 2021/08/11 14:30:26 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strcpy(char *dest, char *src);
int main(void)
{
char src[32];
char dest[32];
char *result;
printf("Input [max 31]: ");
scanf("%s", src);
result = ft_strcpy(dest, src);
printf("src=%s dest=%s result=%s (ft_strcpy)\n", src, dest, result);
result = strcpy(dest, src);
printf("src=%s dest=%s result=%s (strcpy)\n", src, dest, result);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,37 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 18:18:58 by gbaconni #+# #+# */
/* Updated: 2021/08/11 18:07:07 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strncpy(char *dest, char *src, unsigned int n);
int main(void)
{
char src[32];
char dest[64];
unsigned int n;
char *result;
n = 0;
printf("Input String [max 31]: ");
scanf("%s", src);
printf("Input Size: ");
scanf("%d", &n);
result = ft_strncpy(dest, src, n);
printf("src=%s dest=%s n=%d result=%s (ft_strncpy)\n", src, dest, n, result);
result = strncpy(dest, src, n);
printf("src=%s dest=%s n=%d result=%s (strncpy)\n", src, dest, n, result);
return (0);
}

View File

@@ -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

Binary file not shown.

View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 17:44:56 by gbaconni #+# #+# */
/* Updated: 2021/08/09 17:48:47 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int ft_str_is_alpha(char *str);
int main(void)
{
char str[32];
int result;
printf("Input [max 31]: ");
scanf("%s", str);
result = ft_str_is_alpha(str);
printf("str=%s result=%d\n", str, result);
return (0);
}

View File

@@ -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

Binary file not shown.

View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/10 10:13:03 by gbaconni #+# #+# */
/* Updated: 2021/08/10 10:15:13 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int ft_str_is_numeric(char *str);
int main(void)
{
char str[32];
int result;
printf("Input [max 31]: ");
scanf("%s", str);
result = ft_str_is_numeric(str);
printf("str=%s result=%d\n", str, result);
return (0);
}

View File

@@ -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

Binary file not shown.

View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/10 10:44:33 by gbaconni #+# #+# */
/* Updated: 2021/08/10 10:44:58 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int ft_str_is_lowercase(char *str);
int main(void)
{
char str[32];
int result;
printf("Input [max 31]: ");
scanf("%s", str);
result = ft_str_is_lowercase(str);
printf("str=%s result=%d\n", str, result);
return (0);
}

View File

@@ -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

Binary file not shown.

View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/10 10:48:33 by gbaconni #+# #+# */
/* Updated: 2021/08/10 10:48:53 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int ft_str_is_uppercase(char *str);
int main(void)
{
char str[32];
int result;
printf("Input [max 31]: ");
scanf("%s", str);
result = ft_str_is_uppercase(str);
printf("str=%s result=%d\n", str, result);
return (0);
}

View File

@@ -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

Binary file not shown.

View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/10 11:05:36 by gbaconni #+# #+# */
/* Updated: 2021/08/10 11:05:59 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int ft_str_is_printable(char *str);
int main(void)
{
char str[32];
int result;
printf("Input [max 31]: ");
scanf("%s", str);
result = ft_str_is_printable(str);
printf("str=%s result=%d\n", str, result);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/10 11:12:33 by gbaconni #+# #+# */
/* Updated: 2021/08/10 11:25:31 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strupcase(char *str);
int main(void)
{
char str[32];
char *result;
printf("Input [max 31]: ");
scanf("%s", str);
printf("str=%s\n", str);
result = ft_strupcase(str);
printf("str=%s result=%s\n", str, result);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/10 11:40:15 by gbaconni #+# #+# */
/* Updated: 2021/08/10 11:40:52 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strlowcase(char *str);
int main(void)
{
char str[32];
char *result;
printf("Input [max 31]: ");
scanf("%s", str);
printf("str=%s\n", str);
result = ft_strlowcase(str);
printf("str=%s result=%s\n", str, result);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/10 11:43:49 by gbaconni #+# #+# */
/* Updated: 2021/08/10 11:55:53 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strcapitalize(char *str);
int main(void)
{
char str[256];
char *result;
printf("Input [max 255]: ");
scanf("%255[^\n]", str);
printf("str=%s\n", str);
result = ft_strcapitalize(str);
printf("str=%s result=%s\n", str, result);
return (0);
}

View File

@@ -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

Binary file not shown.

View File

@@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/11 09:43:24 by gbaconni #+# #+# */
/* Updated: 2021/08/11 10:43:00 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
unsigned int ft_strlcpy(char *dest, char *src, unsigned int size);
int main(void)
{
unsigned int size;
unsigned int result;
char src[16];
char dest[16];
printf("Input Text [max 15]: ");
scanf("%15[^\n]", src);
printf("Input Size: ");
scanf("%u", &size);
result = ft_strlcpy(dest, src, size);
printf("src=%s dest=%s result=%d (ft_strlcpy)\n", src, dest, result);
result = strlcpy(dest, src, size);
printf("src=%s dest=%s result=%d (strlcpy)\n", src, dest, result);
return (0);
}

View File

@@ -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

Binary file not shown.

View File

@@ -0,0 +1,32 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/11 11:24:31 by gbaconni #+# #+# */
/* Updated: 2021/08/12 11:44:53 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
void ft_putstr_non_printable(char *str);
int main(void)
{
const char *test = "Coucou\ntu vas bien ?";
char str[256];
printf("Input [max 255]: ");
scanf("%255[^\n]", str);
printf("str=%s\n", str);
ft_putstr_non_printable(str);
printf("test=%s\n", test);
ft_putstr_non_printable((char *)test);
return (0);
}

View File

@@ -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

View File

@@ -1,7 +0,0 @@
**/main.c
**/main.sh
**/a.out
**/a.sh
**/Makefile
**/*.swp
**/*~

View File

@@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/12 12:15:09 by gbaconni #+# #+# */
/* Updated: 2021/08/12 12:28:31 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int ft_strcmp(char *s1, char *s2);
int main(void)
{
char s1[32];
char s2[32];
int result;
printf("Input String #1 [max 31]: ");
scanf("%s", s1);
printf("Input String #2 [max 31]: ");
scanf("%s", s2);
result = ft_strcmp(s1, s2);
printf("s1=%s s2=%s result=%d (ft_strcmp)\n", s1, s2, result);
result = strcmp(s1, s2);
printf("s1=%s s2=%s result=%d (strcmp)\n", s1, s2, result);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,39 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/12 15:16:20 by gbaconni #+# #+# */
/* Updated: 2021/08/12 15:16:21 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int ft_strncmp(char *s1, char *s2, unsigned int n);
int main(void)
{
char s1[32];
char s2[32];
unsigned int n;
int result;
n = 0;
printf("Input String #1 [max 31]: ");
scanf("%s", s1);
printf("Input String #2 [max 31]: ");
scanf("%s", s2);
printf("Input Number: ");
scanf("%u", &n);
result = ft_strncmp(s1, s2, n);
printf("s1=%s s2=%s n=%d result=%d (ft_strncmp)\n", s1, s2, n, result);
result = strncmp(s1, s2, n);
printf("s1=%s s2=%s n=%d result=%d (strncmp)\n", s1, s2, n, result);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,37 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/12 15:28:30 by gbaconni #+# #+# */
/* Updated: 2021/08/12 15:49:44 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strcat(char *dest, char *src);
int main(void)
{
char src[32];
char dest[32];
char dest2[32];
char *result;
printf("Input String #1 [max 31]: ");
scanf("%s", src);
printf("Input String #2 [max 31]: ");
scanf("%s", dest);
strcpy(dest2, dest);
result = ft_strcat(dest, src);
printf("src=%s dest=%s result=%s (ft_strcat)\n", src, dest, result);
result = strcat(dest2, src);
printf("src=%s dest=%s result=%s (strcat)\n", src, dest2, result);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,41 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/12 16:21:11 by gbaconni #+# #+# */
/* Updated: 2021/08/12 16:44:38 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strncat(char *dest, char *src, unsigned int nb);
int main(void)
{
char src[32];
char dest[32];
char dest2[32];
unsigned int nb;
char *r;
nb = 0;
printf("Input String #1 [max 31]: ");
scanf("%s", src);
printf("Input String #2 [max 31]: ");
scanf("%s", dest);
printf("Input Number: ");
scanf("%u", &nb);
strcpy(dest2, dest);
r = ft_strncat(dest, src, nb);
printf("src=%s dest=%s nb=%d result=%s (ft_strncat)\n", src, dest, nb, r);
r = strncat(dest2, src, nb);
printf("src=%s dest=%s nb=%d result=%s (strncat)\n", src, dest2, nb, r);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/12 16:49:41 by gbaconni #+# #+# */
/* Updated: 2021/08/12 17:07:20 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
char *ft_strstr(char *str, char *to_find);
int main(void)
{
char str[32];
char to_find[32];
char *r;
printf("Input String #1 [max 31]: ");
scanf("%s", str);
printf("Input String #2 [max 31]: ");
scanf("%s", to_find);
r = ft_strstr(str, to_find);
printf("str=%s to_find=%s result=%s (ft_strstr)\n", str, to_find, r);
r = strstr(str, to_find);
printf("str=%s to_find=%s result=%s (strstr)\n", str, to_find, r);
return (0);
}

View File

@@ -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

View File

@@ -0,0 +1,40 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/12 15:28:30 by gbaconni #+# #+# */
/* Updated: 2021/08/12 17:22:10 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
unsigned int ft_strlcat(char *dest, char *src, unsigned int size);
int main(void)
{
char src[32];
char dest[32];
unsigned int size;
unsigned int r;
size = 0;
r = 0;
printf("Input String #1 [max 31]: ");
scanf("%s", src);
printf("Input String #2 [max 31]: ");
scanf("%s", dest);
printf("Input Number: ");
scanf("%u", &size);
r = ft_strlcat(dest, src, size);
printf("src=%s dest=%s size=%d r=%d (ft_strlcat)\n", src, dest, size, r);
r = strlcat(dest, src, size);
printf("src=%s dest=%s size=%d r=%d (strlcat)\n", src, dest, size, r);
return (0);
}

View File

@@ -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

View File

@@ -1,7 +0,0 @@
**/main.c
**/main.sh
**/a.out
**/a.sh
**/Makefile
**/*.swp
**/*~

View File

@@ -1,2 +0,0 @@
.DS_Store
mywork.c~