Standard C++ Library Reference ISO/IEC (VERSION3)
strstr
char *strstr(const char *s1,
const char *s2); [not in C++]
const char *strstr(const char *s1,
const char *s2); [C++ only]
char *strstr(char *s1, const char *s2); [C++ only]
The function searches for the first sequence of elements in the string s1 that matches the
sequence of elements in the string s2, not including its terminating null character. If successful,
the function returns the address of the matching first element; otherwise, it returns a null
pointer.
strtok
char *strtok(char *s1, const char *s2);
If s1 is not a null pointer, the function begins a search of the string s1. Otherwise, it begins a
search of the string whose address was last stored in an internal static-duration object on an
earlier call to the function, as described below. The search proceeds as follows:
The function searches the string for begin, the address of the first element that equals
none of the elements of the string s2 (a set of token separators). It considers the
terminating null character as part of the search string only.
1.
If the search does not find an element, the function stores the address of the terminating
null character in the internal static-duration object (so that a subsequent search beginning
with that address will fail) and returns a null pointer. Otherwise, the function searches
from begin for end, the address of the first element that equals any one of the elements
of the string s2. It again considers the terminating null character as part of the search
string only.
2.
If the search does not find an element, the function stores the address of the terminating
null character in the internal static-duration object. Otherwise, it stores a null character in
the element whose address is end. Then it stores the address of the next element after
end in the internal static-duration object (so that a subsequent search beginning with that
address will continue with the remaining elements of the string) and returns begin.
3.
strxfrm
size_t strxfrm(char *s1, const char *s2, size_t n);
The function stores a string in the array of char whose first element has the address s1. It stores
no more than n characters, including the terminating null character, and returns the number of
characters needed to represent the entire string, not including the terminating null character. If
the value returned is n or greater, the values stored in the array are indeterminate. (If n is zero,