Localization library | |||||||||||||||||||||||||
Regular expressions library(C++11) | |||||||||||||||||||||||||
Formatting library(C++20) | |||||||||||||||||||||||||
Null-terminated sequence utilities | |||||||||||||||||||||||||
Byte strings | |||||||||||||||||||||||||
Multibyte strings | |||||||||||||||||||||||||
Wide strings | |||||||||||||||||||||||||
Primitive numeric conversions | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
Text encoding identifications | |||||||||||||||||||||||||
|
Functions | ||||||||||||||||||||||||||||||||||||
Character classification | ||||||||||||||||||||||||||||||||||||
Character manipulation | ||||||||||||||||||||||||||||||||||||
Conversions to numeric formats | ||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||
String manipulation | ||||||||||||||||||||||||||||||||||||
String examination | ||||||||||||||||||||||||||||||||||||
Character array functions | ||||||||||||||||||||||||||||||||||||
Miscellaneous | ||||||||||||||||||||||||||||||||||||
Defined in header <cstring> | ||
constvoid* memchr(constvoid* ptr,int ch,std::size_t count); | ||
void* memchr( void* ptr,int ch,std::size_t count); | ||
Convertsch tounsignedchar and locates the first occurrence of that value in the initialcount bytes (each interpreted asunsignedchar) of the object pointed to byptr.
This function behaves as if it reads the bytes sequentially and stops as soon as a matching bytes is found: if the array pointed to byptr is smaller thancount, but the match is found within the array, the behavior is well-defined. | (since C++17) |
Contents |
ptr | - | pointer to the object to be examined |
ch | - | byte to search for |
count | - | max number of bytes to examine |
Pointer to the location of the byte, or a null pointer if no such byte is found.
Search an array of characters.
Output:
search character found
finds the first occurrence of a character (function)[edit] | |
(C++11) | finds the first element satisfying specific criteria (function template)[edit] |
C documentation formemchr |