I am looking for the positions of an element using find(); method, but for some reason it conflicts whit the cout<< and I don't understand why.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, busquedas, num,
vas=0, pet=0;
vector <int> arreglo;
cin>>n;
for(int i = 0; i < n; i++){
cin>> num;
arreglo.push_back(num);
}
cin>>busquedas;
for(int i = 0; i < busquedas; i++){
cin>>num;
std::vector<int>::iterator it = std::find(arreglo.begin(), arreglo.end(), num);
cout<<it; //Here the error occurs
}
return 0; }
Also I have tried to change the iterator to the auto type and it shows the same error.