Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 467 Bytes

find.md

File metadata and controls

16 lines (13 loc) · 467 Bytes

find

Description : Returns the first element in the range [first, last) that satisfies specific criteria(searches for an element equal to value).

Example:

    std::vector<int> v{ 1, 2, 3, 4, 4, 3, 7, 8, 9, 10 };

    int searchme = 4;
    if(std::find(std::begin(v), std::end(v), searchme) != std::end(v)){
        std::cout <<"\n v contains 4";
    }
    else
        std::cout<<"No match !!";

Run Code