#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
    std::vector<int> v = {3,4,5,6,7,8,9};
    
    int pos = -1;
    std::vector<int>::iterator it;
    
    if((it = std::find(v.begin(), v.end(), 6)) != v.end())
        pos = it - v.begin();
        
    std::cout << "6 is at pos " << pos << std::endl;
}