find()

The elements within the container are compared for equality with value. If a match is found, the search ends. find() returns an iterator to the element. If no match is found, container.end() is returned.

#include <algorithm> 
piter = find( ia, ia+8, value ); 
iter  = find( svec.begin(), svec.end(), "rosebud" ); 

Get Essential C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.