Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

vector find

#include <bits/stdc++.h>
using namespace std;
int main()
{
    vector<int>v ;
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    v.push_back(4);
    v.push_back(5);
    v.push_back(6);
    vector<int>::iterator it;
    it=find(v.begin(),v.end(),4);
    if(it!=v.end())
    cout<<it-v.begin()<<endl;
    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vector #find
ADD COMMENT
Topic
Name
5+6 =