std::char_traits<CharT>::find (3) - Linux Manuals

std::char_traits<CharT>::find: std::char_traits<CharT>::find

NAME

std::char_traits<CharT>::find - std::char_traits<CharT>::find

Synopsis


static const char_type* find( const char_type* p, std::size_t count, const char_type& ch ); (until C++17)
static constexpr const char_type* find( const char_type* p, std::size_t count, const char_type& ch ); (since C++17)


Searches for character ch within the first count characters of the sequence pointed to by p.

Parameters


p - pointer to a character string to search
count - the number of characters to analyze
ch - the character to search for

Return value


A pointer to the first character in the range specified by [p, p + count) that compares equal to ch, or NULL if not found.

Exceptions


(none)

Complexity


Linear in count.