add: strlen
This commit is contained in:
commit
e0eb95588f
10
src/string/strlen.c
Normal file
10
src/string/strlen.c
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
size_t strlen(const char *str)
|
||||||
|
{
|
||||||
|
const char *start = str;
|
||||||
|
|
||||||
|
while (*start != '\0')
|
||||||
|
start++;
|
||||||
|
return start - str;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user