You will probably want two functions: one that generates all the subsets of the input string, and one that generates all the permutations of a given string. Then you can do something like the following to generate all the permutations of all the subsets:
[code=c++]
string input_string;
cin >> input_string;
vector<string> subsets; // this will store all the subsets of the input string
vector<string> permutations; // this will store all the permutations of a single subset
vector<string> permutations_of_subsets; // this will store all the permutations of all the subsets which is our ultimate goal
// First we find all the subsets
subsets = find_subsets( input_string );
// Now we generate all the permutations on all of these subsets
vector<string>::iterator iter;
for( iter = subsets.begin(); iter != subsets.end(); iter++ ) {
// For this subset, find the permutations
permutations = find_permutations( *iter );
// Add these to all the permutations we have so far
permutations_of_subsets.insert( permutations_of_subsets.start(), permutations.start(), permutations.end() );
}
// Now we go through each string in permutations_of_subsets and look it up in the dictionary.....
[/code]
Here is a site I just googled and looks promising for permutations code. It looks like they use char* instead of string, but you can easily convert between the two using c_str().
http://www.bearcave.com/random_hacks/permute.html
At first glance I couldn't find a subsets function, but this could be a good exercise anyway :)