This commit is contained in:
Bananymous
2022-11-15 21:42:14 +02:00
parent 35e21ca4ce
commit 123382eace
13 changed files with 299 additions and 66 deletions

9
libc/string/strstr.cpp Normal file
View File

@@ -0,0 +1,9 @@
#include <string.h>
char* strstr(const char* haystack, const char* needle)
{
for (size_t i = 0; haystack[i]; i++)
if (memcmp(haystack + i, needle, strlen(needle)) == 0)
return (char*)haystack + i;
return NULL;
}