Alphabet Permutation (All possible combinations)

So I have been coding a small program in C++ that prints all possible combinations of up to 3 characters (all capital letters A-Z) but it seems that all my code is, are nested for loops.

It works great don't get me wrong, but if i decide to make it scalable, to the whole alphabet, or to include numbers or lowercase letters,,, do i really have to nest that many for loops? or is there a method in c++ that I am unaware of to do this quickly and more efficient??
Not really.

If you want to scale the number of characters (all combinations of 4 character or all combinations of 15 characters), you can use a recursive function so you don't need to keep nesting more loops in your code. But the recursive call is really a nested loop in this case.
Last edited on
thanks, figured as much. good to get some confirmation on that
Topic archived. No new replies allowed.