Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

size of unordered_set

// C++ program to illustrate the 
// unordered_set.size() function 
#include <iostream>
#include <unordered_set>
  
using namespace std;
  
int main()
{
  
    unordered_set<int> arr1 = { 1, 2, 3, 4, 5 };
  
    // prints the size of arr1
    cout << "size of arr1:" << arr1.size();
  
    // prints the element
    cout << "
The elements are: ";
    for (auto it = arr1.begin(); it != arr1.end(); it++)
        cout << *it << " ";
  
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #size
ADD COMMENT
Topic
Name
1+5 =