October 1999
Beginner
304 pages
7h 11m
English
Each generic algorithm, with the fistful of exceptions that make the rule, begins with a pair of iterators that marks the range of elements within the container over which to traverse. The range begins with the first iterator and ends with but does not include the second:
const int array_size = 7;
int iarray[array_size] = { 1, 10, 8, 4, 3, 14, 8 };
vector<int> vec( iarray, iarray+ array_size );
vector<int>::iterator it = find( vec.begin(), vec.end(), value );
int *pi = find( iarray, iarray+array_size, value ); The algorithms are generally
overloaded to support two versions: one that uses either the built-in ...
Read now
Unlock full access