
strpbrk
7-54
Find Any Matching Character
strpbrk
Syntax
#include <string.h>
char *
strpbrk
(const char *string, const char *chs);
Defined in
strpbrk.c in rts.src
Description
The strpbrk function locates the first occurrence in string of
any
character in
chs. If strpbrk finds a matching character, it returns a pointer to that character;
otherwise, it returns a null pointer (0).
Example
char *stra = ”it wasn’t me”;
char *strb = ”wave”;
char *a;
a = strpbrk (stra,strb);
After this example, a points to the w in wasn’t.
Find Last Occurrence of a Character
strrchr
Syntax
#include <string.h>
char *
strrchr
(const char *string, int c);
Defined in
strrchr.c in rts.src
Description
The strrchr function finds the last occurrence of c in string. If strrchr finds the
character, it returns a pointer to the character; otherwise, it returns a null point-
er (0). The strrchr function is expanded inline if the
−
x option is used.
Example
char *a = ”When zz comes home, the search is on for z’s”;
char *b;
char the_z = ’z’;
After this example, *b points to the z near the end of the string.
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...