Mega Code Archive

 
Categories / C++ / Set Multiset
 

Create sets with string elements

#include <set> #include <iostream> #include <string> using namespace std; template <class T> void print(T& c){    for( typename T::iterator i = c.begin(); i != c.end(); i++ ){       std::cout << *i << endl;    } } int main() {   set<string> first;   first.insert("r");   first.insert("T");   first.insert("s"); }