Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (14 sloc) 413 Bytes
#include <algorithm>
#include <iostream>
#include <vector>
int main(void) {
int v[] = { 1, 2, 3, 4 };
int* p = std::find(v, v + 4, 3);
++p;
std::cout << "The element following 3 is: " << *p << std::endl;
std::vector<int> v1(v, v + 4);
std::vector<int>::iterator iter(std::find(v1.begin(), v1.end(), 3));
++iter;
std::cout << "The element following 3 is: " << *iter << std::endl;
return 0;
}