strchr, strrchr, strstr
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The strchr, strrchr, and strstr functions operate on null-
terminated strings. The <string> arguments to these functions are
expected to contain a null character (\0) marking the end of the
string. No overflow checking is performed when strings are copied
or appended.
The strchr function returns a pointer to the first occurrence of
<c> in <string>. The character <c> may be the null character
(\0); the terminating null character of <string> is included in
the search. The function returns NULL if the character is not
found.
The strrchr function finds the last occurrence of the character
<c> in <string>. The string's terminating null character (\0) is
included in the search. The strrchr function returns a pointer to
the last occurrence of <c> in <string>. A NULL pointer is returned
if the given character is not found.
The strstr function returns a pointer to the first occurrence of
<string2> in <string1>. The function returns NULL if it does not
find <string2> in <string1>.
The _f... forms of these functions are model-independent (large-
model) forms that use far pointer forms of the string arguments
and return values. These model-independent functions can be called
from any point in the program.
Return Value
The return values for these functions are described above.
-♦-