- 论坛徽章:
- 1
|
strstr的使用???
Function: char * strstr (const char *haystack, const char *needle)
This is like strchr, except that it searches haystack for a substring needle rather than just a single character. It returns a pointer into the string haystack that is the first character of the substring, or a null pointer if no match was found. If needle is an empty string, the function returns haystack.
For example,
strstr ("hello, world", "l"
=>; "llo, world"
strstr ("hello, world", "wo"
=>; "world" |
|