I\'m attempting to write a program that will generate a text file with every possible permutation of the alphabet from one character up to twenty-nine characters. I\'ve chosen 2
void out_perms(std::string word) {
std::vector indexes(word.size());
for (size_t i = 0; i < indexes.size(); ++i)
indexes[i] = i;
do {
for (size_t i = 0; i < indexes.size(); ++i)
std::cout << word[indexes[i]];
std::cout << std::endl;
} while (std::next_permutation(indexes.begin(), indexes.end()));
}
int main(int, char**) {
out_perms("asdfg");
}
See http://codepad.org/6lQTPQrG for example output