3 ms·
Here's my behavior: strstr(NULL, /* valid string */) I can't find the needle in the haystack (actually, I can't find anything in the haystack. I can't find
by saagarjha 7y ago
Here's my behavior:
strstr(NULL, /* valid string */)
I can't find the needle in the haystack (actually, I can't find anything in the haystack. I can't find the haystack.) Thus I return NULL.
strstr(/* valid string */, NULL)
I can't find the needle in the haystack (actually, I wouldn't be able to find it: I don't know what I'm looking for.) Return NULL.
- codehero 7y agoYou're explanation is not inconsistent with my proposal, but you don't seem to grasp VALIDITY.