Here the recursion idea is that you start with a vector of digits v_in to pick from and an empty vector of digits v_out where a combination can be put. Then at this point any one of the digits you have in v_in can be placed in the next slot of v_out to start a new combination. So you can loop for every digit in v_in, add it with v_out to get v_next, copy all the other digits of v_in into v_remain, and recursively call back the same function with v_next -> v_out and v_remain -> v_in. Once there is no more digits in v_in, you should have a full combination, and you just print it out with cout.
thanks for the help but think this is just beyond me at the moment
need to do some more reading i think
was following some of your explanation but go lost
need to learn more about recursion and functions
THANKS FOR THE HELP
you can always use the next_permutation function located in <algorithm>. As mike said you will need to break up then number into each digit and put them into some kind of container. Vectors work well for this. then you will need to sort the container to have the smallest digit at the front of the array. Then you can use a counter variable and a while statement to add up all of the permutations you can get.
int counter = 0;
vector<int> container; // put each digit here
// sort the vector
// now counter has the number of permutations
next_permutation did the job nicely
now gonna go and find out how it works
feel like i should know how to write my own algorithms
this might slow my learning but hate using something i dont understand
just me being me :)
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...