How to create a set of sets in C++?
set<char> inner1;
set<char> inner2;
set< set<char> > outer;
set< set<char> >:: iterator new_it;
set<char>::iterator it;
for (int i = 65; i < 70; ++i)
inner1.insert(i);
for (int i = 70; i < 80; ++i)
inner2.insert(i);
outer.insert(inner1);
outer.insert(inner2);
for(new_it=outer.begin();new_it!=outer.end();new_it++)
{
for(it=*(new_it);it!=(new_it);)
{
}
}
You can't assign new_it
to it
in the inner loop. Do it this way:
for(it = new_it->begin(); it!=new_it->end(); ++it)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With