The implementation based on the StackExchange question and answers. Also added some improvements.
#include <stdlib.h>
void* memmem(const void* haystack, size_t haystackLen,
const void* needle, size_t needleLen)
{
/* The first occurrence of the empty string is deemed to occur at