Standard C++ Library Reference ISO/IEC (VERSION3)
unsigned char), the function returns a positive number.
Otherwise, it returns a negative number.●
strncpy
char *strncpy(char *s1, const char *s2, size_t n);
The function copies the string s2, not including its terminating null character, to successive
elements of the array of char whose first element has the address s1. It copies no more than n
characters from s2. The function then stores zero or more null characters in the next elements
to be altered in s1 until it stores a total of n characters. It returns s1.
strpbrk
char *strpbrk(const char *s1,
const char *s2); [not in C++]
const char *strpbrk(const char *s1,
const char *s2); [C++ only]
char *strpbrk(char *s1,
const char *s2); [C++ only]
The function searches for the first element s1[i] in the string s1 that equals any one of the
elements of the string s2. It considers each terminating null character as part of its string. If
s1[i] is not the terminating null character, the function returns &s1[i]; otherwise, it returns
a null pointer.
strrchr
char *strrchr(const char *s, int c); [not in C++]
const char *strrchr(const char *s, int c); [C++ only]
char *strrchr(char *s, int c); [C++ only]
The function searches for the last element of the string s that equals (char)c. It considers the
terminating null character as part of the string. If successful, the function returns the address of
the matching element; otherwise, it returns a null pointer.
strspn
size_t strspn(const char *s1, const char *s2);
The function searches for the first element s1[i] in the string s1 that equals none of the
elements of the string s2 and returns i. It considers the terminating null character as part of the
string s1 only.