VOOZH about

URL: https://www.geeksforgeeks.org/cpp/unordered_multimap-clear-function-in-c-stl/

⇱ unordered_multimap clear() function in C++ STL - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

unordered_multimap clear() function in C++ STL

Last Updated : 8 Aug, 2018
The unordered_multimap::clear() is a built-in function in C++ STL which clears the contents of the unordered_multimap container. The final size of the container after the call of the function is 0. Syntax:
unordered_multimap_name.clear()
Parameters: The function does not accept any parameter. Return Value: It returns nothing. Below programs illustrates the above function: Program 1:
Output:
Key and Elements of multimap are:
{15, 150}
{30, 300}
{20, 200}
{10, 100}
{10, 100}
Size of container after function call: 0
Program 2:
Output:
Key and Elements of multimap are:
{c, b}
{r, a}
{b, c}
{a, b}
{a, b}
Size of container after function call: 0
Comment