Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

find in vector


    it = find (vec.begin(), vec.end(), ser);
    if (it != vec.end())
    {
        cout << "Element " << ser <<" found at position : " ;
        cout << it - vec.begin() << " (counting from zero) 
" ;
    }
    else{
        cout << "Element not found.

";
    }
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #find #vector
ADD COMMENT
Topic
Name
8+9 =