C++ Set
Set is an associate container for storing unique sets.
Syntax:
set<object_type> s1;
Example:
#include <iostream> #include <set> using namespace std; int main(void) { //Default Constructor std::set<int> s1; s1.insert(5); s1.insert(10); cout << "Size of set for s1 is : " << s1.size() << endl; set<int> s2(s1); // Copy constructor cout << "Size of set for s2 is : " << s2.size(); return 0; }
Quickly Find What You Are Looking For
OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.