#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main () {
int myints[] = { 10, 20, 30 ,40 };
int * p;
// pointer to array element:
p = find(myints,myints+4,33);
cout << *p << endl;
vector<int> myvector (myints,myints+4);
vector<int>::iterator it;
// iterator to vector element:
it = find (myvector.begin(), myvector.end(), 33);
cout << *it << endl;
return 0;
}
u mnie na kompie pokazuje mi (GCC)
33
śmieci
na ideone pokazuje
śmieci
0
a według tego http://www.cplusplus.com/reference/algorithm/find/
powinno w obu przypadkach zwrócić 40
WTF?