This is an algorithm (not my own) that prints out the possible permutations of a string. In function "permute" I cout[ed] some variables in order to know their values at different times during the execution of a program in order to learn its working. What I find is assuming is how can the value of "place" possibly be equal to 1 after it has had a value of 2. There is nothing that decrements "place". I have made a comment in the program so you guys know exactly what I am talking about.
Denis, the idea is to demonstrate the problem using recursion specifically. Using STL algorithms isn't much of a feat, my friend. The best part, however, is that the code actually does what it is supposed to do i.e. permute the string. I just wanna know how it does that.