VOOZH about

URL: https://www.geeksforgeeks.org/cpp/unordered_multiset-begin-function-in-c-stl/

⇱ unordered_multiset begin() function in C++ STL - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

unordered_multiset begin() function in C++ STL

Last Updated : 2 Aug, 2018
The unordered_multiset::begin() is a built-in function in C++ STL which returns an iterator pointing to the first element in the container or to the first element in one of its bucket. Syntax:
unordered_multiset_name.begin(n)
Parameters: The function accepts one parameter. If a parameter is passed, it returns an iterator pointing to the first element in the bucket. If no parameter is passed, then it returns an iterator pointing to the first element in the unordered_multiset container. Return Value: It returns an iterator. Below programs illustrates the above function: Program 1:
Output:
The first element: 14
Elements: 14 13 15 10 11
Program 2:
Output:
The first element: z
The second element: x
Elements: z x c a b
Program 3:
Output:
The first element in first bucket : x
Elements in first bucket: x c
Comment