if (needle == "") return haystack;
I have this one-liner that would specifically handle the case where if needle empty, then return the pointer to the haystack.
Yet when I compiled this code, the returned result is NULL. Is there something wrong with the test case? Compiled locally, my result is the first pointer to the haystack.