ft_strlen.c

This commit is contained in:
Timo Schmidt 2023-03-27 00:59:55 +02:00
commit 038cded5c0
1 changed files with 33 additions and 0 deletions

33
ex00/ft_strlen.c Normal file
View File

@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/27 00:57:16 by tischmid #+# #+# */
/* Updated: 2023/03/27 00:58:43 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strlen(char *str)
{
int i;
i = 0;
while (*str++)
++i;
return (i);
}
/* ////
#include <stdio.h>
int main(void)
{
char str[10] = "Hello";
printf("%d\n", ft_strlen(str));
return (0);
}
*/ ////