fork download
  1. //Run Code To Demonstrate use of set.size()
  2. #include<iostream>
  3. #include<set>
  4.  
  5.  
  6. int main(){
  7. // Create a set object holding integers
  8. std::set<int> mySet {1,2,3,4,-5};
  9.  
  10. std::cout << "Size of my set is : " << mySet.size() << std::endl;
  11.  
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 4392KB
stdin
Standard input is empty
stdout
Size of my set is : 5