0
0
This commit is contained in:
Guy Baconniere
2021-08-20 10:02:38 +02:00
parent 5aa02c94b5
commit d30270c485
354 changed files with 0 additions and 0 deletions

23
C_01/git/ex06/ft_strlen.c Normal file
View File

@@ -0,0 +1,23 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/09 11:23:08 by gbaconni #+# #+# */
/* Updated: 2021/08/09 17:03:24 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strlen(char *str)
{
int size;
size = 0;
while (str[size] != '\0')
{
size++;
}
return (size);
}

29
C_01/git/ex06/main.c Normal file
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);
}

7
C_01/git/ex06/main.sh Executable file
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