Is it possible to generate sets in a loop, where the loop comes up with a new name for the set? I am trying to do the following:
//create storage structure for options according to hops
int lengthOfStart = start.length();
for (int i = 0; i<start.length();++i) {
string nameOfSet = "Hop" + i;
Set<string> nameOfSet;
wordLadderOptions.enqueue(nameOfSet);
}
I am using a slightly modified version of traditional c++ set which just offers some more functions for data manipulation but otherwise the set is same as the one built in to c++ standard library. When I say Set<string> nameOfSet;
the compiler sees this as the actual name of the set and not a variable...
How can I make it see it as a variable in order to create sets in the for loop based on the variable i's value?