The [...] function returns a pointer to the beginning of the substring, or NULL if the substring is not found.
memmem behaves similar to strstr with the difference that the string can contain \0 hence the explicit length. It should return a pointer to the sub -string (within the "haystack") where the "needle" starts. Additionally your logic is wrong, you can't find "C" in "AB"
Обсуждают сегодня