memmem
—find memory segment#include <string.h> char *memmem(const void *s1, size_t l1, const void *s2, size_t l2);
Description
Locates the first occurrence in the memory region pointed to
by s1 with length l1 of the sequence of bytes pointed
to by s2 of length l2. If you already know the
lengths of your haystack and needle, memmem
can be much
faster than strstr
.
Returns
Portability
memmem
is a newlib extension.
memmem
requires no supporting OS subroutines.