diff --git a/CheatSheets/cpp-stl-cheatsheet.md b/CheatSheets/cpp-stl-cheatsheet.md index f2f0356..2ed9891 100644 --- a/CheatSheets/cpp-stl-cheatsheet.md +++ b/CheatSheets/cpp-stl-cheatsheet.md @@ -9,6 +9,7 @@ - [Vector sort](#vector) - [Vector reverse](#vector) - [Vector deletion](#vector) + - [Vector find](#vector) - [Set](#set) - [Set insertion](#set) - [Set Display](#set) @@ -93,6 +94,15 @@ { cout << v[i] << " "; } + + //Vector find + int search = 30; + vector::iterator it; + it = find(v.begin(), v.end(), search); + if(it != v.end()) + { + cout << "Position: " << it + v.begin() << endl; + } ``` **[🔼Back to Top](#table-of-contents)**