commit e0eb95588f7d37ca7fb17a6734dc67c8599c190a Author: starnakin Date: Fri Sep 6 23:08:29 2024 +0200 add: strlen diff --git a/src/string/strlen.c b/src/string/strlen.c new file mode 100644 index 0000000..5cad17d --- /dev/null +++ b/src/string/strlen.c @@ -0,0 +1,10 @@ +#include + +size_t strlen(const char *str) +{ + const char *start = str; + + while (*start != '\0') + start++; + return start - str; +}