Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CheatSheets/cpp-stl-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Vector sort](#vector)
- [Vector reverse](#vector)
- [Vector deletion](#vector)
- [Vector find](#vector)
- [Set](#set)
- [Set insertion](#set)
- [Set Display](#set)
Expand Down Expand Up @@ -93,6 +94,15 @@
{
cout << v[i] << " ";
}

//Vector find
int search = 30;
vector<int>::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)**
Expand Down