- 论坛徽章:
- 0
|
SYNOPSIS
#include <string.h>
char *strstr(const char *haystack, const char *needle);
DESCRIPTION
The strstr() function finds the first occurrence of the substring nee-
dle in the string haystack.
RETURN VALUE
The strstr() function returns a pointer to the beginning of the sub-
string, or NULL if the substring is not found.
SYNOPSIS
#include <string.h>
char *strtok(char *s, const char *delim);
DESCRIPTION
The strtok() function can be used to parse the string s into tokens.
The first call to strtok() should have s as its first argument. Subse-
quent calls should have the first argument set to NULL. Each call
returns a pointer to the next token, or NULL when no more tokens are
found.
If a token ends with a delimiter, this delimiting character is over-
written with a \0 and a pointer to the next character is saved for the
next call to strtok(). The delimiter string delim may be different for
each call.
The strtok_r() function is a reentrant version of the strtok() func-
tion, which instead of using its own static buffer, requires a pointer
to a user allocated char*. This pointer, the ptrptr parameter, must be
the same while parsing the same string.
或者楼主到baidu google 随便一搜 |
|