Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

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