Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

find element 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 #element #vector
ADD COMMENT
Topic
Name
8+6 =